Skip to content

Commit b9ba442

Browse files
committed
vsv: do not ignore empty fields in first row (#139)
1 parent 7168776 commit b9ba442

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/vsv/extension.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,10 @@ static char* vsv_read_one_field(VsvReader* p) {
511511
}
512512
if (p->z) {
513513
p->z[p->n] = 0;
514+
} else {
515+
// p->z is initially NULL, so if the content row starts with empty fields,
516+
// we need to set p->z to an empty string (see issue #139).
517+
vsv_append(p, 0);
514518
}
515519
p->bNotFirst = 1;
516520
return p->z;

0 commit comments

Comments
 (0)