grep-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

grep branch, master, updated. v2.20-11-g639bfd8


From: Paul Eggert
Subject: grep branch, master, updated. v2.20-11-g639bfd8
Date: Fri, 27 Jun 2014 19:32:05 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".

The branch, master has been updated
       via  639bfd84e719c451d810015d51386f6a0cc47a0d (commit)
      from  a5ef4c423bc583333cb465b72eff7b0dca7f68db (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=639bfd84e719c451d810015d51386f6a0cc47a0d


commit 639bfd84e719c451d810015d51386f6a0cc47a0d
Author: Paul Eggert <address@hidden>
Date:   Fri Jun 27 12:31:29 2014 -0700

    grep: with -E, unmatched ')' matches itself
    
    Problem reported by Nathan Weeks in: http://bugs.gnu.org/17856
    * src/grep.c (Ecompile): Also specify RE_UNMATCHED_RIGHT_PAREN_ORD.
    * doc/grep.texi (Fundamental Structure), NEWS: Document this.
    * tests/ere.tests: Add a couple of tests for this.
    * tests/spencer1.tests: Fix exit status.

diff --git a/NEWS b/NEWS
index 1af3def..550bf4c 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,10 @@ GNU grep NEWS                                    -*- outline 
-*-
 
   Performance has improved for very long strings in patterns.
 
+** Bug fixes
+
+  grep -E rejected unmatched ')', instead of treating it like '\)'.
+  [bug present since "the beginning"]
 
 * Noteworthy changes in release 2.20 (2014-06-03) [stable]
 
diff --git a/doc/grep.texi b/doc/grep.texi
index c9417e5..10cc2e4 100644
--- a/doc/grep.texi
+++ b/doc/grep.texi
@@ -1208,6 +1208,7 @@ Repetition takes precedence over concatenation,
 which in turn takes precedence over alternation.
 A whole expression may be enclosed in parentheses
 to override these precedence rules and form a subexpression.
+An unmatched @samp{)} matches just itself.
 
 @node Character Classes and Bracket Expressions
 @section Character Classes and Bracket Expressions
diff --git a/src/grep.c b/src/grep.c
index 7c0f8a8..f2fca74 100644
--- a/src/grep.c
+++ b/src/grep.c
@@ -1638,7 +1638,9 @@ Gcompile (char const *pattern, size_t size)
 static void
 Ecompile (char const *pattern, size_t size)
 {
-  GEAcompile (pattern, size, RE_SYNTAX_POSIX_EGREP | RE_NO_EMPTY_RANGES);
+  GEAcompile (pattern, size,
+              (RE_SYNTAX_POSIX_EGREP | RE_NO_EMPTY_RANGES
+               | RE_UNMATCHED_RIGHT_PAREN_ORD));
 }
 
 static void
diff --git a/tests/ere.tests b/tests/ere.tests
index e0aad2a..8ab6510 100644
--- a/tests/ere.tests
+++ b/tests/ere.tests
@@ -215,3 +215,6 @@
 address@hidden|address@hidden
 address@hidden@ab
 address@hidden@ESIZE
+0@)@)
+1@)@x
address@hidden()\((a\())(b))@()(a()b)
diff --git a/tests/spencer1.tests b/tests/spencer1.tests
index 36c0b9e..50581e8 100644
--- a/tests/spencer1.tests
+++ b/tests/spencer1.tests
@@ -59,7 +59,7 @@
 address@hidden(address@hidden
 address@hidden(address@hidden((b
 address@hidden@a\x
address@hidden)@-
address@hidden)@-
 2@(address@hidden
 0@((a))@abc
 0@(a)b(c)@abc

-----------------------------------------------------------------------

Summary of changes:
 NEWS                 |    4 ++++
 doc/grep.texi        |    1 +
 src/grep.c           |    4 +++-
 tests/ere.tests      |    3 +++
 tests/spencer1.tests |    2 +-
 5 files changed, 12 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
grep



reply via email to

[Prev in Thread] Current Thread [Next in Thread]