bin: fix handling of \r\n with %>

Fix issue #380.

* bin/common_finput.cc: Erase a trailing \r.
* tests/core/ltl2tgba2.test: Test it.
* NEWS: Mention the fix.
This commit is contained in:
Alexandre Duret-Lutz 2019-03-20 21:31:11 +01:00
parent af67c04a67
commit 7af47c7db5
3 changed files with 15 additions and 1 deletions

View file

@ -154,6 +154,11 @@ job_processor::process_stream(std::istream& is,
}
else // We are reading column COL_TO_READ in a CSV file.
{
// Some people save CSV files with MSDOS encoding, and
// we don't want to include the \r in any %> output.
if (*line.rbegin() == '\r')
line.pop_back();
// If the line we have read contains an odd number
// of double-quotes, then it is an incomplete CSV line
// that should be completed by the next lines.