If multiple carriage returns occur within a line, they are lost by read_line. Here's a test showing the error:
# let i = BatIO.input_string "kldsjf\r\r\rasdfa\nsfdsagf\n";;
val i : BatIO.input = <abstr>
# BatIO.read_line i;;
- : string = "kldsjf\rasdfa"
I marked this as an easy fix, but performance is important for a low-level function like this. Making sure that a fix is efficient may require more work.
Fix #276: handle multiple \r, more tests