diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2015-07-04 07:06:50 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2015-07-04 08:38:43 -0700 |
commit | 4629191813aca41fa65cfba698683e662e41a5a5 (patch) | |
tree | 17e818c3ea61b942b21e93f3d8990b9a4bf9f3d9 /tests/utf8-bracket | |
parent | 0e8fda0d880cccd0e1997a905eb9a7910f957245 (diff) | |
download | grep-4629191813aca41fa65cfba698683e662e41a5a5.tar.gz |
grep: -z '[^x]' now consistently matches newline
Problem reported by Norihiro Tanaka in: http://bugs.gnu.org/20974#19
* NEWS: Document this.
* src/grep.c (Gcompile, Ecompile): Clear RE_HAT_LISTS_NOT_NEWLINE.
* tests/utf8-bracket: Test this.
Diffstat (limited to 'tests/utf8-bracket')
-rwxr-xr-x | tests/utf8-bracket | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/utf8-bracket b/tests/utf8-bracket index f5c4a60d..b63afbb8 100755 --- a/tests/utf8-bracket +++ b/tests/utf8-bracket @@ -24,9 +24,15 @@ printf '1\n2\n' >in || framework_failure_ fail=0 for locale in C en_US.UTF-8; do - for pattern in '1.2' '[12].2' '[1-2].2'; do - for suffix in '' '\(\)\1'; do - LC_ALL=$locale grep --null-data --quiet "$pattern$suffix" in || fail=1 + for options in -qz -qzE; do + case $options in + *E*) parens='()';; + *) parens='\(\)';; + esac + for pattern in '1.2' '[12].2' '[1-2].2' '[1-2][^a][1-2]'; do + for suffix in '' "$parens\\1"; do + LC_ALL=$locale grep $options "$pattern$suffix" in || fail=1 + done done done done |