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 /src | |
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 'src')
-rw-r--r-- | src/grep.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1862,15 +1862,17 @@ static void Gcompile (char const *pattern, size_t size) { GEAcompile (pattern, size, - RE_SYNTAX_GREP | RE_DOT_NEWLINE | RE_NO_EMPTY_RANGES); + ((RE_SYNTAX_GREP | RE_DOT_NEWLINE | RE_NO_EMPTY_RANGES) + & ~RE_HAT_LISTS_NOT_NEWLINE)); } static void Ecompile (char const *pattern, size_t size) { GEAcompile (pattern, size, - (RE_SYNTAX_POSIX_EGREP | RE_DOT_NEWLINE - | RE_NO_EMPTY_RANGES | RE_UNMATCHED_RIGHT_PAREN_ORD)); + ((RE_SYNTAX_POSIX_EGREP | RE_DOT_NEWLINE + | RE_NO_EMPTY_RANGES | RE_UNMATCHED_RIGHT_PAREN_ORD) + & ~RE_HAT_LISTS_NOT_NEWLINE)); } static void |