ruby / csv

CSV Reading and Writing
https://ruby.github.io/csv/
BSD 2-Clause "Simplified" License
178 stars 113 forks source link

Fix for parser getting confused after faulty row with CRLF line ending. #220

Closed anakinj closed 2 years ago

anakinj commented 2 years ago

It looks like the parser is currently not able to fully ignore a broken line because of the regex used for detecting the line ending in the file. The current behaviour will move the parser to the first \r char in the line. But for files using CRLF as line endings that is not enough.

This PR changes the detection to consider the combinations \r\n or \r or \n when ignoring a broken line.

anakinj commented 2 years ago

Thanks for the feedback @kou. PR updated accordingly.

kou commented 2 years ago

Thanks. I've merged.