diff options
author | Adrian Kummerlaender | 2016-04-22 22:23:35 +0200 |
---|---|---|
committer | Adrian Kummerlaender | 2016-04-22 22:23:35 +0200 |
commit | 5eb3689c9985f28b46651f547b9b32d55b4a07b5 (patch) | |
tree | 798b747b241de9f9233fa7b5dc6ce96a2fbbcde5 /justify.cc | |
parent | b647d08bb19abe4d199166a05f9f14c65f5f0ed4 (diff) | |
download | justify-5eb3689c9985f28b46651f547b9b32d55b4a07b5.tar justify-5eb3689c9985f28b46651f547b9b32d55b4a07b5.tar.gz justify-5eb3689c9985f28b46651f547b9b32d55b4a07b5.tar.bz2 justify-5eb3689c9985f28b46651f547b9b32d55b4a07b5.tar.lz justify-5eb3689c9985f28b46651f547b9b32d55b4a07b5.tar.xz justify-5eb3689c9985f28b46651f547b9b32d55b4a07b5.tar.zst justify-5eb3689c9985f28b46651f547b9b32d55b4a07b5.zip |
Handle input stream EOF
Diffstat (limited to 'justify.cc')
-rw-r--r-- | justify.cc | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -81,8 +81,12 @@ bool process(const boost::program_options::variables_map& variables) { justify::LineAccumulator acc{line_length, line_offset}; std::string token; - while ( std::cin >> token ) { - acc(token); + while ( std::cin.good() ) { + if ( std::cin >> token ) { + acc(token); + } else { + return true; + } } return true; |