Update of /cvsroot/q-lang/q-csv
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv8888
Modified Files:
csv.c
Log Message:
must test for null char instead of EOF to determine string end
Index: csv.c
===================================================================
RCS file: /cvsroot/q-lang/q-csv/csv.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** csv.c 14 Jan 2008 04:41:33 -0000 1.8
--- csv.c 14 Jan 2008 06:15:17 -0000 1.9
***************
*** 167,171 ****
} else if (!strncmp(sp, strdl, 1)) {
goto st1;
! } else if (*sp == '\n' || *sp == EOF) {
putrec(FORCEQUOTE);
goto st10;
--- 167,171 ----
} else if (!strncmp(sp, strdl, 1)) {
goto st1;
! } else if (*sp == '\n' || *sp == 0) {
putrec(FORCEQUOTE);
goto st10;
***************
*** 180,184 ****
if (!strncmp(sp, strdl, 1)) {
goto st2;
! } else if (*sp == EOF) {
goto st20;
} else {
--- 180,184 ----
if (!strncmp(sp, strdl, 1)) {
goto st2;
! } else if (*sp == 0) {
goto st20;
} else {
***************
*** 193,197 ****
putrec(FORCEQUOTE);
goto st0;
! } else if (*sp == '\n' || *sp == EOF) {
putrec(FORCEQUOTE);
goto st10;
--- 193,197 ----
putrec(FORCEQUOTE);
goto st0;
! } else if (*sp == '\n' || *sp == 0) {
putrec(FORCEQUOTE);
goto st10;
***************
*** 206,210 ****
putrec(FORCEQUOTE);
goto st0;
! } else if (*sp == '\n' || *sp == EOF) {
putrec(FORCEQUOTE);
goto st10;
--- 206,210 ----
putrec(FORCEQUOTE);
goto st0;
! } else if (*sp == '\n' || *sp == 0) {
putrec(FORCEQUOTE);
goto st10;
***************
*** 219,223 ****
putrec(AUTOQUOTE);
goto st0;
! } else if (*sp == '\n' || *sp == EOF) {
putrec(AUTOQUOTE);
goto st10;
--- 219,223 ----
putrec(AUTOQUOTE);
goto st0;
! } else if (*sp == '\n' || *sp == 0) {
putrec(AUTOQUOTE);
goto st10;
***************
*** 238,242 ****
putrec(AUTOQUOTE);
goto st0;
! } else if (*sp == '\n' || *sp == EOF) {
fieldp -= ws_cnt; /* get rid of ws at the end of the field */
putrec(AUTOQUOTE);
--- 238,242 ----
putrec(AUTOQUOTE);
goto st0;
! } else if (*sp == '\n' || *sp == 0) {
fieldp -= ws_cnt; /* get rid of ws at the end of the field */
putrec(AUTOQUOTE);
|