# HG changeset patch # User Mychaela Falconia # Date 1695691052 0 # Node ID 66cbbd7d85cf3c362709e3925a1b2c7e81a710e1 # Parent 957fb6e085771d93c190e91484162924032f5fc0 ftee-gen*: allow trailing ws and comments after ftdi-chip and eeprom settings diff -r 957fb6e08577 -r 66cbbd7d85cf fteeprom/ftee-gen2232c.c --- a/fteeprom/ftee-gen2232c.c Tue Sep 26 00:38:58 2023 +0000 +++ b/fteeprom/ftee-gen2232c.c Tue Sep 26 01:17:32 2023 +0000 @@ -60,9 +60,22 @@ } static void +take_one_arg(arg) + char *arg; +{ + char *cp; + + for (cp = arg; *cp && !isspace(*cp); cp++) + ; + if (*cp) + *cp = '\0'; +} + +static void ftdi_chip_setting(arg, filename_for_errs, lineno) char *arg, *filename_for_errs; { + take_one_arg(arg); if (!strcasecmp(arg, "FT2232C")) return; if (!strcasecmp(arg, "FT2232D")) @@ -78,6 +91,7 @@ eeprom_setting(arg, filename_for_errs, lineno) char *arg, *filename_for_errs; { + take_one_arg(arg); if (!strcasecmp(arg, "93C46")) eeprom_chip = 0x46; else if (!strcasecmp(arg, "93C56")) diff -r 957fb6e08577 -r 66cbbd7d85cf fteeprom/ftee-gen2232h.c --- a/fteeprom/ftee-gen2232h.c Tue Sep 26 00:38:58 2023 +0000 +++ b/fteeprom/ftee-gen2232h.c Tue Sep 26 01:17:32 2023 +0000 @@ -60,9 +60,22 @@ } static void +take_one_arg(arg) + char *arg; +{ + char *cp; + + for (cp = arg; *cp && !isspace(*cp); cp++) + ; + if (*cp) + *cp = '\0'; +} + +static void ftdi_chip_setting(arg, filename_for_errs, lineno) char *arg, *filename_for_errs; { + take_one_arg(arg); if (!strcasecmp(arg, "FT2232H")) return; if (!strcasecmp(arg, "FT2232x")) @@ -76,6 +89,7 @@ eeprom_setting(arg, filename_for_errs, lineno) char *arg, *filename_for_errs; { + take_one_arg(arg); if (!strcasecmp(arg, "93C46")) eeprom_chip = 0x46; else if (!strcasecmp(arg, "93C56")) diff -r 957fb6e08577 -r 66cbbd7d85cf fteeprom/ftee-gen232r.c --- a/fteeprom/ftee-gen232r.c Tue Sep 26 00:38:58 2023 +0000 +++ b/fteeprom/ftee-gen232r.c Tue Sep 26 01:17:32 2023 +0000 @@ -24,9 +24,22 @@ unsigned eeprom_string_ptr = 0x0C; static void +take_one_arg(arg) + char *arg; +{ + char *cp; + + for (cp = arg; *cp && !isspace(*cp); cp++) + ; + if (*cp) + *cp = '\0'; +} + +static void ftdi_chip_setting(arg, filename_for_errs, lineno) char *arg, *filename_for_errs; { + take_one_arg(arg); if (!strcasecmp(arg, "FT232R")) return; fprintf(stderr, "%s line %d: config is for wrong FTDI chip\n",