fix BasicParser::readUntilEOL
This commit is contained in:
parent
ccccf22541
commit
aaf8053b87
@ -283,9 +283,12 @@ std::basic_string_view<CharT> BasicParser<CharT>::readUntilWhitespace() {
|
||||
template <typename CharT>
|
||||
std::basic_string_view<CharT> BasicParser<CharT>::readUntilEOL() {
|
||||
int start = pos;
|
||||
while (hasNext() && source[pos] != '\r' && source[pos] != '\n') {
|
||||
while (hasNext() && source[pos] != '\n') {
|
||||
pos++;
|
||||
}
|
||||
if (pos > start && source[pos - 1] == '\r') {
|
||||
return source.substr(start, pos - start - 1);
|
||||
}
|
||||
return source.substr(start, pos - start);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user