aboutsummaryrefslogtreecommitdiff
path: root/t/t7008-grep-binary.sh
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2010-05-22 23:35:07 +0200
committerJunio C Hamano <gitster@pobox.com>2010-05-24 11:22:07 -0700
commitf96e56733ab3e3ce5c79c27c673c746af1519a86 (patch)
tree42f6ba5116cb3c3f16165617a54c1b35438a8d5e /t/t7008-grep-binary.sh
parent52d799a79f921cc47823a0455b0e646636410b65 (diff)
downloadgit-f96e56733ab3e3ce5c79c27c673c746af1519a86.tar.gz
git-f96e56733ab3e3ce5c79c27c673c746af1519a86.tar.xz
grep: use REG_STARTEND for all matching if available
Refactor REG_STARTEND handling inlook_ahead() into a new helper, regmatch(), and use it for line matching, too. This allows regex matching beyond NUL characters if regexec() supports the flag. NUL characters themselves are not matched in any way, though. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7008-grep-binary.sh')
-rwxr-xr-xt/t7008-grep-binary.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t7008-grep-binary.sh b/t/t7008-grep-binary.sh
index 9660842c4..4f5e74fed 100755
--- a/t/t7008-grep-binary.sh
+++ b/t/t7008-grep-binary.sh
@@ -59,4 +59,14 @@ test_expect_success 'git grep -Fi iLE a' '
git grep -Fi iLE a
'
+# This test actually passes on platforms where regexec() supports the
+# flag REG_STARTEND.
+test_expect_failure 'git grep ile a' '
+ git grep ile a
+'
+
+test_expect_failure 'git grep .fi a' '
+ git grep .fi a
+'
+
test_done