diff fteeprom/ftee-gen2232c.c @ 77:66cbbd7d85cf

ftee-gen*: allow trailing ws and comments after ftdi-chip and eeprom settings
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 26 Sep 2023 01:17:32 +0000
parents 7ff9b4857aaf
children
line wrap: on
line diff
--- 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"))