grep: update boundary variable for pre-context
commit6653a01bf2dd1e2aabbcf1f83269bd75737acc94
authorRené Scharfe <l.s.r@web.de>
Sat, 18 Nov 2017 18:07:13 +0000 (18 19:07 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 21 Nov 2017 00:36:06 +0000 (21 09:36 +0900)
tree9ac23d46c137a73337ae5fd9c441899d426af95c
parent76e650d7d95662749fa5cbcc9f4faefb510334b0
grep: update boundary variable for pre-context

Function context can be bigger than -A/-B/-C context.  To find the
beginning of the combined context we search backwards.  Currently we
check at each loop iteration what we're looking for and determine the
effective upper boundary based on that.

Simplify this a bit by setting the variable "from" to the lowest unshown
line number up front if we're looking for a function line and set it
back to the required -B/-C context line number when we find one.  This
prepares the ground for the next patch; no functional change intended.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
grep.c