Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'builtin-grep.c')
-rw-r--r--builtin-grep.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin-grep.c b/builtin-grep.c
index 2124fa62e8..e87b5cb48d 100644
--- 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++;
}