Crash if csv is ending with carriage-return
maxthoursie opened this issue · comments
Max Thoursie commented
user=> (charred.api/read-csv "header\r1\r")
Error printing return value at charred.CharReader/unread (CharReader.java:122).
Unread too far - current buffer empty
Since carriage-return seems to be a supported line separator, this is clearly an error.
There seems to be a related problem in clojure.data.csv. It doesn't crash, but it doesn't trim the last newline as it does for \n
user=> (clojure.data.csv/read-csv "header\r1\r")
(["header"] ["1"] ["�"])
This is with charred 1.007
Chris Nuernberger commented
Agreed - Definitely an error
Chris Nuernberger commented
Fixed 1.008 - thanks great detailed catch.
Max Thoursie commented
Thanks for a super quick fix!