See patch.
Uwe. -- http://hermann-uwe.de | http://sigrok.org http://randomprojects.org | http://unmaintained-free-software.org
Make all programmer/CLI options case-insensitive. There's no need to make life for our user unnecessarily hard, and we already have many case-insensitive options where strcasecmp() is used. Signed-off-by: Uwe Hermann <[email protected]> Index: dummyflasher.c =================================================================== --- dummyflasher.c (Revision 1399) +++ dummyflasher.c (Arbeitskopie) @@ -147,7 +147,7 @@ goto dummy_init_out; } #if EMULATE_SPI_CHIP - if (!strcmp(tmp, "M25P10.RES")) { + if (!strcasecmp(tmp, "M25P10.RES")) { emu_chip = EMULATE_ST_M25P10_RES; emu_chip_size = 128 * 1024; emu_max_byteprogram_size = 128; @@ -160,7 +160,7 @@ msg_pdbg("Emulating ST M25P10.RES SPI flash chip (RES, page " "write)\n"); } - if (!strcmp(tmp, "SST25VF040.REMS")) { + if (!strcasecmp(tmp, "SST25VF040.REMS")) { emu_chip = EMULATE_SST_SST25VF040_REMS; emu_chip_size = 512 * 1024; emu_max_byteprogram_size = 1; @@ -173,7 +173,7 @@ msg_pdbg("Emulating SST SST25VF040.REMS SPI flash chip (REMS, " "byte write)\n"); } - if (!strcmp(tmp, "SST25VF032B")) { + if (!strcasecmp(tmp, "SST25VF032B")) { emu_chip = EMULATE_SST_SST25VF032B; emu_chip_size = 4 * 1024 * 1024; emu_max_byteprogram_size = 1; Index: cli_classic.c =================================================================== --- cli_classic.c (Revision 1399) +++ cli_classic.c (Arbeitskopie) @@ -341,7 +341,7 @@ if (chip_to_probe) { for (flash = flashchips; flash && flash->name; flash++) - if (!strcmp(flash->name, chip_to_probe)) + if (!strcasecmp(flash->name, chip_to_probe)) break; if (!flash || !flash->name) { fprintf(stderr, "Error: Unknown chip '%s' specified.\n", Index: internal.c =================================================================== --- internal.c (Revision 1399) +++ internal.c (Arbeitskopie) @@ -142,7 +142,7 @@ char *arg; arg = extract_programmer_param("boardenable"); - if (arg && !strcmp(arg,"force")) { + if (arg && !strcasecmp(arg, "force")) { force_boardenable = 1; } else if (arg && !strlen(arg)) { msg_perr("Missing argument for boardenable.\n"); @@ -156,7 +156,7 @@ free(arg); arg = extract_programmer_param("boardmismatch"); - if (arg && !strcmp(arg,"force")) { + if (arg && !strcasecmp(arg, "force")) { force_boardmismatch = 1; } else if (arg && !strlen(arg)) { msg_perr("Missing argument for boardmismatch.\n"); @@ -170,7 +170,7 @@ free(arg); arg = extract_programmer_param("laptop"); - if (arg && !strcmp(arg,"force_I_want_a_brick")) { + if (arg && !strcasecmp(arg, "force_I_want_a_brick")) { force_laptop = 1; } else if (arg && !strlen(arg)) { msg_perr("Missing argument for laptop.\n"); Index: flashrom.8 =================================================================== --- flashrom.8 (Revision 1399) +++ flashrom.8 (Arbeitskopie) @@ -85,8 +85,7 @@ Probe only for the specified flash ROM chip. This option takes the chip name as printed by .B "flashrom \-L" -without the vendor name as parameter. Please note that the chip name is -case sensitive. +without the vendor name as parameter. .TP .B "\-m, \-\-mainboard" [<vendor>:]<board> Override mainboard settings. Index: w29ee011.c =================================================================== --- w29ee011.c (Revision 1399) +++ w29ee011.c (Arbeitskopie) @@ -30,7 +30,7 @@ chipaddr bios = flash->virtual_memory; uint8_t id1, id2; - if (!chip_to_probe || strcmp(chip_to_probe, flash->name)) { + if (!chip_to_probe || strcasecmp(chip_to_probe, flash->name)) { msg_cdbg("Old Winbond W29* probe method disabled because " "the probing sequence puts the AMIC A49LF040A in " "a funky state. Use 'flashrom -c %s' if you " Index: flashrom.c =================================================================== --- flashrom.c (Revision 1399) +++ flashrom.c (Arbeitskopie) @@ -1135,7 +1135,7 @@ char *tmp; for (flash = flashchips + startchip; flash && flash->name; flash++) { - if (chip_to_probe && strcmp(flash->name, chip_to_probe) != 0) + if (chip_to_probe && strcasecmp(flash->name, chip_to_probe) != 0) continue; buses_common = buses_supported & flash->bustype; if (!buses_common) {
_______________________________________________ flashrom mailing list [email protected] http://www.flashrom.org/mailman/listinfo/flashrom
