liquidaty/zsv

Non-blank cell emitted for empty files

snizovtsev opened this issue · 2 comments

Hi,

I use zsv library to parse simple csv files with fixed number of columns and expect zsv to emit a known number of cells for each row. However, empty files breaks that rule emitting a non-empty cell:

$ examples/lib/build/simple /dev/null
Row 1 has 1 columns of which 1 is non-blank
$ examples/lib/build/pull /dev/null
Row 1 has 1 columns of which 1 is non-blank

I think zsv should handle that case and return zsv_next_row(zsv) != zsv_status_row on first invocation.

$ git describe --tags
v0.3.5-alpha-7-g7780dac

Should be fixed in branch #111. Please take a look / confirm. Thanks for reporting this issue!

The fix works for me. Thank you!