From 77cf1f75833c1460ca96bffe47553d0174f96b49 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Thu, 22 Dec 2011 21:31:48 +0000 Subject: [PATCH] Handle Windows newlines in line_iterator on non-Windows Originally committed to SVN as r6141. --- aegisub/libaegisub/include/libaegisub/line_iterator.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aegisub/libaegisub/include/libaegisub/line_iterator.h b/aegisub/libaegisub/include/libaegisub/line_iterator.h index e7ad29459..afee984d6 100644 --- a/aegisub/libaegisub/include/libaegisub/line_iterator.h +++ b/aegisub/libaegisub/include/libaegisub/line_iterator.h @@ -194,6 +194,8 @@ void line_iterator::next() { std::string str, cstr, *target; if (width == 1) { std::getline(*stream, str); + if (str.size() && *str.rbegin() == '\r') + str.resize(str.size() - 1); } else { getline(str);