Minor fix to get_next_word(...)

This commit is contained in:
Stephen Seo 2023-12-14 19:37:50 +09:00
parent e4850ca3e1
commit 3fee6e2538

View file

@ -16,7 +16,11 @@ std::string get_next_word(std::istream *i) {
if (in != std::char_traits<char>::eof() && in != ' ' && in != '\n' && in != '\r') { if (in != std::char_traits<char>::eof() && in != ' ' && in != '\n' && in != '\r') {
word.push_back((char)in); word.push_back((char)in);
} else if (in == ' '|| in == '\n' || in == '\r' || in == '\t') { } else if (in == ' '|| in == '\n' || in == '\r' || in == '\t') {
if (word.empty()) {
break; break;
} else {
continue;
}
} }
} }