projects
/
selector.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
90657ab
)
Fixed a bug with getline() failing at the EOF.
author
Francois Fleuret
<francois@fleuret.org>
Sat, 28 Mar 2009 22:38:50 +0000
(23:38 +0100)
committer
Francois Fleuret
<francois@fleuret.org>
Sat, 28 Mar 2009 22:38:50 +0000
(23:38 +0100)
selector.cc
patch
|
blob
|
history
diff --git
a/selector.cc
b/selector.cc
index
f5b9d2d
..
3f8aba7
100644
(file)
--- a/
selector.cc
+++ b/
selector.cc
@@
-544,14
+544,14
@@
int main(int argc, char **argv) {
file.getline(raw_line, buffer_size);
- if(file.fail()) {
- cerr << "Line too long." << endl;
- cerr << raw_line << endl;
- exit(1);
- }
-
if(raw_line[0]) {
+ if(file.fail()) {
+ cerr << "Line too long:" << endl;
+ cerr << raw_line << endl;
+ exit(1);
+ }
+
char *s, *t;
const char *u;