diff options
Diffstat (limited to 'ext/misc/csv.c')
-rw-r--r-- | ext/misc/csv.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/ext/misc/csv.c b/ext/misc/csv.c index e0afdd5d2..ec90f96f2 100644 --- a/ext/misc/csv.c +++ b/ext/misc/csv.c @@ -205,7 +205,8 @@ static int csv_append(CsvReader *p, char c){ ** + Store the character that terminates the field in p->cTerm. Store ** EOF on end-of-file. ** -** Return "" at EOF. Return 0 on an OOM error. +** Return 0 at EOF or on OOM. On EOF, the p->cTerm character will have +** been set to EOF. */ static char *csv_read_one_field(CsvReader *p){ int c; @@ -213,7 +214,7 @@ static char *csv_read_one_field(CsvReader *p){ c = csv_getc(p); if( c==EOF ){ p->cTerm = EOF; - return ""; + return 0; } if( c=='"' ){ int pc, ppc; @@ -544,8 +545,7 @@ static int csvtabConnect( pNew->nCol = nCol; }else{ do{ - const char *z = csv_read_one_field(&sRdr); - if( z==0 ) goto csvtab_connect_oom; + csv_read_one_field(&sRdr); pNew->nCol++; }while( sRdr.cTerm==',' ); } @@ -663,7 +663,6 @@ static int csvtabNext(sqlite3_vtab_cursor *cur){ do{ z = csv_read_one_field(&pCur->rdr); if( z==0 ){ - csv_xfer_error(pTab, &pCur->rdr); break; } if( i<pTab->nCol ){ |