Changeset 1483 for trunk/cbtable.c


Ignore:
Timestamp:
01/04/12 01:48:27 (5 months ago)
Author:
hailfinger
Message:

Replace --mainboard with -p internal:mainboard

--mainboard is a relic from a time before external programmers and makes
the CLI inconsistent.
Use a programmer parameter instead and free up the short option -m.

NOTE:
The --list-supported-wiki output changed to use -p internal:mainboard=
instead of -m
The --list-supported output changed the heading of the mainboard list
from

Vendor Board Status Required option
to
Vendor Board Status Required value for

-p internal:mainboard=

Fix lb_vendor_dev_from_string() not to write to the supplied string.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@…>
Acked-by: Stefan Tauner <stefan.tauner@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cbtable.c

    r1284 r1483  
    3434int partvendor_from_cbtable = 0; 
    3535 
    36 void lb_vendor_dev_from_string(char *boardstring) 
    37 { 
     36/* Parse the [<vendor>:]<board> string specified by the user as part of 
     37 * -p internal:mainboard=[<vendor>:]<board> and set lb_vendor and lb_part 
     38 * to the extracted values. 
     39 * Note: strtok modifies the original string, so we work on a copy and allocate 
     40 * memory for lb_vendor and lb_part with strdup. 
     41 */ 
     42void lb_vendor_dev_from_string(const char *boardstring) 
     43{ 
     44        /* strtok may modify the original string. */ 
     45        char *tempstr = strdup(boardstring); 
    3846        char *tempstr2 = NULL; 
    39         strtok(boardstring, ":"); 
     47        strtok(tempstr, ":"); 
    4048        tempstr2 = strtok(NULL, ":"); 
    4149        if (tempstr2) { 
    42                 lb_vendor = boardstring; 
    43                 lb_part = tempstr2; 
     50                lb_vendor = strdup(tempstr); 
     51                lb_part = strdup(tempstr2); 
    4452        } else { 
    4553                lb_vendor = NULL; 
    46                 lb_part = boardstring; 
    47         } 
     54                lb_part = strdup(tempstr); 
     55        } 
     56        free(tempstr); 
    4857} 
    4958 
Note: See TracChangeset for help on using the changeset viewer.