-
Notifications
You must be signed in to change notification settings - Fork 19
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
fix improper reinitialization of $v_ref #68
Conversation
Thanks for spotting. IMHO the more correct change would be
|
I doubt that. Although this description
of the
would pass. That is weird. It should fail and my change guarantees that. |
If we could at least agree on the same definition with respect to the |
The meaning of |
Ok that means a comment row that is a skipped row should not reinitialize |
How about this one? Tux/Text-CSV_XS@6ed8c31 |
The commit Tux/Text-CSV_XS@6ed8c31 does fix the issue. Thanks. Some possible tidying improvements:
I am asking myself if the error message could/should be improved CSV_XS ERROR: 2014 - ENF - Inconsistent number of fields @ rec 3 pos 3 field 1 Why not mentioning the number of expected fields and the number of fields got? |
|
Ok thanks, any idea when you will release the fix? |
Any time soon when I have time (and currently I have none). |
Initially this pull request was related to |
I still cannot find the new version 1.54 of |
Sorry I have overlooked the statement
We will try to install from github directly. |
This test use Test::More tests => 1;
use Text::CSV_XS qw(csv);
my $data = <<EOC;
# some comment
42 | foo
43 | bar
EOC
is_deeply(
csv( in => \$data, allow_whitespace => 1, auto_diag => 2, strict => 1, comment_str => '#', sep_char => '|' ),
[ [ 42, 'foo' ], [ 43, 'bar' ] ],
'Two records read successfully'
); is failing
although it should not. The problem is that the comment line is the first line. If we move the comment line to the second line the test is successful. |
Could you try Tux/Text-CSV_XS@8cdf92e |
Sorry for the late reply. Everything works as expected. |
When the
comment_str
is set and thestrict
mode is enabled too the first row after the comment row fails with# CSV_PP ERROR: 2014 - ENF - Inconsistent number of fields @ rec 2 pos 10 field 1
The reason is an improper
fld_idx
count which is caused by an improper reinitialiazion of the$v_ref
variable.