Minor fix to get_next_word(...)
This commit is contained in:
parent
e4850ca3e1
commit
3fee6e2538
1 changed files with 5 additions and 1 deletions
|
@ -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') {
|
||||||
break;
|
if (word.empty()) {
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue