1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-05 04:30:38 +03:00

In the command-line shell for CSV import, if the lines are \r\n terminated

and the last field is blank, make sure an empty string and not a "\r" string
is imported.

FossilOrigin-Name: 9c2e7612cd137895e13ee872e668ce1216719d85
This commit is contained in:
drh
2014-02-26 13:53:34 +00:00
parent 434a93147c
commit 3852b68edd
4 changed files with 28 additions and 9 deletions

View File

@@ -1893,7 +1893,7 @@ static char *csv_read_one_field(CSVReader *p){
}
if( c=='\n' ){
p->nLine++;
if( p->n>1 && p->z[p->n-1]=='\r' ) p->n--;
if( p->n>0 && p->z[p->n-1]=='\r' ) p->n--;
}
p->cTerm = c;
}