summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2016-11-19 00:25:46 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2016-11-19 00:35:29 -0800
commit641643e609c7cd4fd2898b3423d3c7ad3106f2e4 (patch)
tree46b8debf06089d0d5c0251d6bf51100db15b87d1 /tests
parent1569ee170b8eb3e5a03ca3d7d53e71fd05fd08e5 (diff)
downloadgrep-641643e609c7cd4fd2898b3423d3c7ad3106f2e4.tar.gz
grep: -Pz no longer rejects ^, $
Problem reported by Stephane Chazelas (Bug#22655). * NEWS: Document this. * doc/grep.texi (grep Programs): Warn about -Pz. * src/pcresearch.c (reflags): New static var. (multibyte_locale): Remove static var; now local to Pcompile. (Pcompile): Check for (? and (* too. Set reflags instead of dying when problematic operators are found. (Pexecute): Use reflags to decide whether searches should be multiline. * tests/pcre: Test new behavior.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/pcre3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/pcre b/tests/pcre
index 8f3d9a48..653ef221 100755
--- a/tests/pcre
+++ b/tests/pcre
@@ -13,8 +13,9 @@ require_pcre_
fail=0
echo | grep -P '\s*$' || fail=1
-echo | returns_ 2 grep -zP '\s$' || fail=1
+echo | grep -zP '\s$' || fail=1
echo '.ab' | returns_ 1 grep -Pwx ab || fail=1
echo x | grep -Pz '[^a]' || fail=1
+printf 'x\n\0' | returns_ 1 grep -zP 'x$' || fail=1
Exit $fail