author | Junio C Hamano <gitster@pobox.com> | |
Sun, 18 Nov 2007 05:18:14 +0000 (21:18 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 18 Nov 2007 05:19:55 +0000 (21:19 -0800) | ||
commit | 4b87474bc9b620cf07b09130e33963cdaf34c603 | |
tree | f41893e4907c7f19955181d7860eea6155e92b2d | tree | snapshot |
parent | 78e694787cb89cd008e237b17cdc7f0fa5a15d22 | commit | diff |
grep -An -Bm: fix invocation of external grep command
When building command line to invoke external grep, the
arguments to -A/-B/-C options were placd in randarg[] buffer,
but the code forgot that snprintf() does not count terminating
NUL in its return value. This caused "git grep -A1 -B2" to
invoke external grep with "-B21 -A1".
Signed-off-by: Junio C Hamano <gitster@pobox.com>
When building command line to invoke external grep, the
arguments to -A/-B/-C options were placd in randarg[] buffer,
but the code forgot that snprintf() does not count terminating
NUL in its return value. This caused "git grep -A1 -B2" to
invoke external grep with "-B21 -A1".
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-grep.c | diff | blob | history |