builtin-grep: terminate correctly at EOF
It barfed and segfaulted with an incomplete line. Signed-off-by: Junio C Hamano <junkio@cox.net>maint
parent
1e3d90e013
commit
7ed36f56e3
|
@ -264,6 +264,8 @@ static int grep_buffer(struct grep_opt *opt, const char *name,
|
||||||
}
|
}
|
||||||
*eol = ch;
|
*eol = ch;
|
||||||
bol = eol + 1;
|
bol = eol + 1;
|
||||||
|
if (!left)
|
||||||
|
break;
|
||||||
left--;
|
left--;
|
||||||
lno++;
|
lno++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue