diff --git a/src/main.cc b/src/main.cc index f01f282..08db272 100644 --- a/src/main.cc +++ b/src/main.cc @@ -16,7 +16,11 @@ std::string get_next_word(std::istream *i) { if (in != std::char_traits::eof() && in != ' ' && in != '\n' && in != '\r') { word.push_back((char)in); } else if (in == ' '|| in == '\n' || in == '\r' || in == '\t') { - break; + if (word.empty()) { + break; + } else { + continue; + } } }