From db38a3bad5d0ce24caea0e647481f14d369d737d Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Mon, 9 Jan 2017 14:26:44 +0100 Subject: Fix textblob bug not reading past empty line --- textblob.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'textblob.cpp') 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)); } } -- cgit v1.2.3-54-g00ecf