fix BasicParser::readUntilEOL

This commit is contained in:
MihailRis 2025-03-24 08:28:06 +03:00
parent ccccf22541
commit aaf8053b87

View File

@ -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);
}