nickle's parse_csv doesn't strip quotes, so we have to
authorKeith Packard <keithp@keithp.com>
Fri, 15 Jul 2016 19:53:50 +0000 (12:53 -0700)
committerKeith Packard <keithp@keithp.com>
Fri, 15 Jul 2016 19:53:50 +0000 (12:53 -0700)
This appears to just be a bug in the nickle code which has been fixed
upstream. This local fix only strips quotes if present, so it will
work with either nickle version unless we have names starting with "

Signed-off-by: Keith Packard <keithp@keithp.com>
bin/partslist-vendor

index 44054c76dee68c90f41d5b0e060b939363112c10..03e3aae4dc2cf7ea855dac121b206a979ff852f7 100755 (executable)
@@ -26,7 +26,11 @@ string[*] read_line(file f) {
        lineno++;
        string  line = fgets(f);
 
-       return String::parse_csv(line);
+       string[*] elts = String::parse_csv(line);
+       for (int i = 0; i < dim(elts); i++)
+               if (elts[i][0] == '"')
+                       elts[i] = String::dequote(elts[i]);
+       return elts;
 }
 
 string[*] header;