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
1 changed files with 2 additions and 0 deletions

View File

@ -194,6 +194,8 @@ void line_iterator<OutputType>::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);