projects
/
libsub.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e15231b
)
Fix end-of-stringstream logic to not miss the last line.
author
Carl Hetherington
<cth@carlh.net>
Fri, 24 Jun 2016 12:30:17 +0000
(13:30 +0100)
committer
Carl Hetherington
<cth@carlh.net>
Fri, 24 Jun 2016 12:30:17 +0000
(13:30 +0100)
src/util.cc
patch
|
blob
|
history
diff --git
a/src/util.cc
b/src/util.cc
index a165126fe311c5bb4a1652e7856d2b354cb08d85..66490c1aeaeb001a83a4ac723cd94211307cf9b3 100644
(file)
--- a/
src/util.cc
+++ b/
src/util.cc
@@
-20,6
+20,7
@@
#include "util.h"
#include <string>
#include <sstream>
+#include <iostream>
#include <cstdio>
using std::string;
@@
-45,12
+46,12
@@
sub::empty_or_white_space (string s)
optional<string>
sub::get_line_stringstream (stringstream* str)
{
- string s;
- getline (*str, s);
if (!str->good ()) {
return optional<string> ();
}
+ string s;
+ getline (*str, s);
return s;
}