grep-commit
[Top][All Lists]
Advanced

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

grep branch, master, updated. v2.26-32-gd6c8415


From: Paul Eggert
Subject: grep branch, master, updated. v2.26-32-gd6c8415
Date: Sun, 20 Nov 2016 07:53:42 +0000 (UTC)

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  d6c8415e9c8c03db4f062a05dc7e7507af350306 (commit)
       via  cfdb4ba4249ac5860979d11436c6a925a298688e (commit)
      from  da94c91a81fc63275371d0580d8688b6abd85346 (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=d6c8415e9c8c03db4f062a05dc7e7507af350306


commit d6c8415e9c8c03db4f062a05dc7e7507af350306
Author: Paul Eggert <address@hidden>
Date:   Sat Nov 19 22:48:37 2016 -0800

    grep: further -P performance fix
    
    Problem reported by Stephane Chazelas in:
    http://bugs.gnu.org/22655#103
    * src/pcresearch.c (Pexecute): Set the subject to the start of
    each line as it is found.

diff --git a/src/pcresearch.c b/src/pcresearch.c
index 1948acf..108baff 100644
--- a/src/pcresearch.c
+++ b/src/pcresearch.c
@@ -194,12 +194,12 @@ Pexecute (char const *buf, size_t size, size_t 
*match_size,
 
   /* The search address to pass to pcre_exec.  This is the start of
      the buffer, or just past the most-recently discovered encoding
-     error.  */
+     error or line end.  */
   char const *subject = buf;
 
-  for (; p < buf + size; p = line_start = line_end + 1)
+  do
     {
-      /* Use a single_line search.  Although this code formerly used
+      /* Search line by line.  Although this code formerly used
          PCRE_MULTILINE for performance, the performance wasn't always
          better and the correctness issues were too puzzling.  See
          Bug#22655.  */
@@ -269,7 +269,9 @@ Pexecute (char const *buf, size_t size, size_t *match_size,
       if (e != PCRE_ERROR_NOMATCH)
         break;
       bol = true;
+      p = subject = line_start = line_end + 1;
     }
+  while (p < buf + size);
 
   if (e <= 0)
     {

http://git.savannah.gnu.org/cgit/grep.git/commit/?id=cfdb4ba4249ac5860979d11436c6a925a298688e


commit d6c8415e9c8c03db4f062a05dc7e7507af350306
Author: Paul Eggert <address@hidden>
Date:   Sat Nov 19 22:48:37 2016 -0800

    grep: further -P performance fix
    
    Problem reported by Stephane Chazelas in:
    http://bugs.gnu.org/22655#103
    * src/pcresearch.c (Pexecute): Set the subject to the start of
    each line as it is found.

diff --git a/src/pcresearch.c b/src/pcresearch.c
index 1948acf..108baff 100644
--- a/src/pcresearch.c
+++ b/src/pcresearch.c
@@ -194,12 +194,12 @@ Pexecute (char const *buf, size_t size, size_t 
*match_size,
 
   /* The search address to pass to pcre_exec.  This is the start of
      the buffer, or just past the most-recently discovered encoding
-     error.  */
+     error or line end.  */
   char const *subject = buf;
 
-  for (; p < buf + size; p = line_start = line_end + 1)
+  do
     {
-      /* Use a single_line search.  Although this code formerly used
+      /* Search line by line.  Although this code formerly used
          PCRE_MULTILINE for performance, the performance wasn't always
          better and the correctness issues were too puzzling.  See
          Bug#22655.  */
@@ -269,7 +269,9 @@ Pexecute (char const *buf, size_t size, size_t *match_size,
       if (e != PCRE_ERROR_NOMATCH)
         break;
       bol = true;
+      p = subject = line_start = line_end + 1;
     }
+  while (p < buf + size);
 
   if (e <= 0)
     {

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

Summary of changes:
 NEWS             |    8 ++--
 src/dfasearch.c  |    2 +-
 src/grep.c       |    4 +-
 src/grep.h       |    1 -
 src/kwsearch.c   |    2 +-
 src/pcresearch.c |  107 +++++++-----------------------------------------------
 src/search.h     |    6 +--
 7 files changed, 26 insertions(+), 104 deletions(-)


hooks/post-receive
-- 
grep



reply via email to

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