summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-07-03 18:23:59 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2015-07-03 18:26:07 -0700
commit0e8fda0d880cccd0e1997a905eb9a7910f957245 (patch)
tree8997572072957a45a77a16dfa7e87ceeb3283b2f /src
parent4fedddefdf373d4335223a4a589d86bccdeca65b (diff)
downloadgrep-0e8fda0d880cccd0e1997a905eb9a7910f957245.tar.gz
grep: -z '.' now consistently matches newline
Problem reported by Balazs Kezes in: http://bugs.gnu.org/20974 * NEWS: Document this. * tests/utf8-bracket: New file, to test for this bug. * src/grep.c (Gcompile, Ecompile): Also specify RE_DOT_NEWLINE. * tests/Makefile.am (TESTS): Add it.
Diffstat (limited to 'src')
-rw-r--r--src/grep.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/grep.c b/src/grep.c
index 778dbcb1..ed54dc23 100644
--- a/src/grep.c
+++ b/src/grep.c
@@ -1861,15 +1861,16 @@ if any error occurs and -q is not given, the exit status is 2.\n"));
static void
Gcompile (char const *pattern, size_t size)
{
- GEAcompile (pattern, size, RE_SYNTAX_GREP | RE_NO_EMPTY_RANGES);
+ GEAcompile (pattern, size,
+ RE_SYNTAX_GREP | RE_DOT_NEWLINE | RE_NO_EMPTY_RANGES);
}
static void
Ecompile (char const *pattern, size_t size)
{
GEAcompile (pattern, size,
- (RE_SYNTAX_POSIX_EGREP | 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));
}
static void