Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-blank cell emitted for empty files #110

Closed
snizovtsev opened this issue Mar 1, 2023 · 2 comments
Closed

Non-blank cell emitted for empty files #110

snizovtsev opened this issue Mar 1, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@snizovtsev
Copy link

snizovtsev commented Mar 1, 2023

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
@liquidaty liquidaty added the bug Something isn't working label Mar 2, 2023
@liquidaty
Copy link
Owner

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

liquidaty added a commit that referenced this issue Mar 2, 2023
… bytes) (#111)

* fix bug in first cell size if file size < BOM length (3 bytes) (issue #110) and add related test
@snizovtsev
Copy link
Author

The fix works for me. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants