From d848eed414a5d5c8bc35a3ec843f01e8b609f60d Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 24 Jun 2016 13:30:17 +0100 Subject: Fix end-of-stringstream logic to not miss the last line. --- src/util.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/util.cc b/src/util.cc index a165126..66490c1 100644 --- a/src/util.cc +++ b/src/util.cc @@ -20,6 +20,7 @@ #include "util.h" #include #include +#include #include using std::string; @@ -45,12 +46,12 @@ sub::empty_or_white_space (string s) optional sub::get_line_stringstream (stringstream* str) { - string s; - getline (*str, s); if (!str->good ()) { return optional (); } + string s; + getline (*str, s); return s; } -- cgit v1.2.3