| Simplify the logic of `"' further a bit, NFCI - csvtofsv - Convert CSV to FSV (… | |
| hg clone https://bitbucket.org/iamleot/csvtofsv | |
| Log | |
| Files | |
| Refs | |
| README | |
| --- | |
| changeset ed27c76334aaf8e4de69097fd7bfaf92ffc85afd | |
| parent 15cc17278b19026cf5d1688a817c1894550eedc8 | |
| Author: Leonardo Taccari <[email protected]> | |
| Date: Wed, 26 Jun 2019 01:14:37 | |
| Simplify the logic of `"' further a bit, NFCI | |
| Diffstat: | |
| csvtofsv.c | 7 +++---- | |
| 1 files changed, 3 insertions(+), 4 deletions(-) | |
| --- | |
| diff -r 15cc17278b19 -r ed27c76334aa csvtofsv.c | |
| --- a/csvtofsv.c Wed Jun 26 01:05:46 2019 +0200 | |
| +++ b/csvtofsv.c Wed Jun 26 01:14:37 2019 +0200 | |
| @@ -46,11 +46,10 @@ | |
| if (first) { | |
| quoted = true; | |
| first = false; | |
| + } else if (!quoted) { | |
| + putchar(c); | |
| } else if ((nc = getchar()) != EOF) { | |
| - if (!quoted) { | |
| - putchar(c); | |
| - ungetc(nc, stdin); | |
| - } else if (nc == '"') { | |
| + if (nc == '"') { | |
| putchar('"'); | |
| } else if (nc == ',') { | |
| putchar(FS); |