grep-commit
[Top][All Lists]
Advanced

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

grep branch, master, updated. v2.20-62-g2a45f93


From: Paul Eggert
Subject: grep branch, master, updated. v2.20-62-g2a45f93
Date: Wed, 15 Oct 2014 18:50:22 +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  2a45f93f4e952f5f27a6eb710854b98a548277b8 (commit)
      from  e9a7702427a897bc4ac0e5b78c91a954c0a6fe4a (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=2a45f93f4e952f5f27a6eb710854b98a548277b8


commit 2a45f93f4e952f5f27a6eb710854b98a548277b8
Author: Paul Eggert <address@hidden>
Date:   Wed Oct 15 11:49:49 2014 -0700

    grep: fix off-by-one bug in -P optimization
    
    Reported by Norihiro Tanaka in: http://bugs.gnu.org/18738
    * src/pcresearch.c (Pexecute): Fix off-by-one bug with
    validation_boundary.
    * tests/init.cfg (envvar_check_fail): Catch off-by-one bug.

diff --git a/src/pcresearch.c b/src/pcresearch.c
index 6f016b6..1fd5bde 100644
--- a/src/pcresearch.c
+++ b/src/pcresearch.c
@@ -214,7 +214,7 @@ Pexecute (char const *buf, size_t size, size_t *match_size,
             options |= PCRE_NO_UTF8_CHECK;
 
           int valid_bytes = validated - p;
-          if (valid_bytes < 0)
+          if (valid_bytes <= 0)
             {
               e = pcre_exec (cre, extra, p, search_bytes, 0,
                              options, sub, NSUB);
diff --git a/tests/init.cfg b/tests/init.cfg
index 3e9ab03..882feb1 100644
--- a/tests/init.cfg
+++ b/tests/init.cfg
@@ -47,7 +47,11 @@ require_timeout_()
 
 require_pcre_()
 {
-  echo . | grep -P . 2>err || skip_ no PCRE support
+  echo . | grep -P . 2>err
+  echo . | grep -P . 2>err || {
+    test $? -eq 1 && fail_ PCRE available, but does not work.
+    skip_ no PCRE support
+  }
   compare /dev/null err || fail_ PCRE available, but stderr not empty.
 }
 

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

Summary of changes:
 src/pcresearch.c |    2 +-
 tests/init.cfg   |    6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
grep



reply via email to

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