Introduction
Introduction Statistics Contact Development Disclaimer Help
Simplify a bit the logic for parsing non-first `"' characters, NFCI - csvtofsv …
hg clone https://bitbucket.org/iamleot/csvtofsv
Log
Files
Refs
README
---
changeset 15cc17278b19026cf5d1688a817c1894550eedc8
parent 1934375d22a116a1139a90874da7ffcf7d24e930
Author: Leonardo Taccari <[email protected]>
Date: Wed, 26 Jun 2019 01:05:46
Simplify a bit the logic for parsing non-first `"' characters, NFCI
Diffstat:
csvtofsv.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
---
diff -r 1934375d22a1 -r 15cc17278b19 csvtofsv.c
--- a/csvtofsv.c Wed Jun 26 00:24:22 2019 +0200
+++ b/csvtofsv.c Wed Jun 26 01:05:46 2019 +0200
@@ -47,19 +47,19 @@
quoted = true;
first = false;
} else if ((nc = getchar()) != EOF) {
- if (quoted && nc == '"') {
+ if (!quoted) {
+ putchar(c);
+ ungetc(nc, stdin);
+ } else if (nc == '"') {
putchar('"');
- } else if (quoted && nc == ',') {
+ } else if (nc == ',') {
putchar(FS);
first = true;
quoted = false;
- } else if (quoted && nc == '\n') {
+ } else if (nc == '\n') {
putchar(RS);
first = true;
quoted = false;
- } else {
- putchar(c);
- ungetc(nc, stdin);
}
}
break;
You are viewing proxied material from tccr.it. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.