Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
builtin-grep: terminate correctly at EOF
[gitweb.git]
/
builtin-grep.c
diff --git
a/builtin-grep.c
b/builtin-grep.c
index 2124fa62e8900754615bf7eb49228a4d2b790d52..e87b5cb48d6eda5ada9a3cd9bb505d8abe36fd41 100644
(file)
--- a/
builtin-grep.c
+++ b/
builtin-grep.c
@@
-264,6
+264,8
@@
static int grep_buffer(struct grep_opt *opt, const char *name,
}
*eol = ch;
bol = eol + 1;
+ if (!left)
+ break;
left--;
lno++;
}