Handle Windows newlines in line_iterator on non-Windows

Originally committed to SVN as r6141.
This commit is contained in:
Thomas Goyne 2011-12-22 21:31:48 +00:00
parent 4c9ebe1a4d
commit 77cf1f7583

View file

@ -194,6 +194,8 @@ void line_iterator<OutputType>::next() {
std::string str, cstr, *target; std::string str, cstr, *target;
if (width == 1) { if (width == 1) {
std::getline(*stream, str); std::getline(*stream, str);
if (str.size() && *str.rbegin() == '\r')
str.resize(str.size() - 1);
} }
else { else {
getline(str); getline(str);