diff options
author | tomsmeding <tom.smeding@gmail.com> | 2017-01-09 14:26:44 +0100 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2017-01-09 14:26:44 +0100 |
commit | db38a3bad5d0ce24caea0e647481f14d369d737d (patch) | |
tree | b79ec4c6433b851b7949e54f65af59bafff7a457 | |
parent | 99142b0661ba8f54e1ff8dda035c67be54cac6a6 (diff) |
Fix textblob bug not reading past empty line
-rw-r--r-- | textblob.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/textblob.cpp b/textblob.cpp index 544b26e..65fa1b0 100644 --- a/textblob.cpp +++ b/textblob.cpp @@ -52,11 +52,9 @@ void TextBlob::clear(){ void TextBlob::read(istream &is){ lines.clear(); - while(true){ - lines.emplace_back(); - getline(is,lines.back()); - if(lines.back().size()==0)break; - if(!is)break; + string ln; + while(getline(is,ln)){ + lines.push_back(move(ln)); } } |