summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-07-04 07:06:50 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2015-07-04 08:38:43 -0700
commit4629191813aca41fa65cfba698683e662e41a5a5 (patch)
tree17e818c3ea61b942b21e93f3d8990b9a4bf9f3d9 /src
parent0e8fda0d880cccd0e1997a905eb9a7910f957245 (diff)
downloadgrep-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.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/grep.c b/src/grep.c
index ed54dc23..9b38cf5d 100644
--- a/src/grep.c
+++ b/src/grep.c
@@ -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