builtin-grep: terminate correctly at EOF

It barfed and segfaulted with an incomplete line.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano 2006-05-03 21:03:25 -07:00
parent 1e3d90e013
commit 7ed36f56e3

View file

@ -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++;
}