grep-commit
[Top][All Lists]
Advanced

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

grep branch, master, updated. v2.6-14-g8f08d8e


From: Paolo Bonzini
Subject: grep branch, master, updated. v2.6-14-g8f08d8e
Date: Thu, 25 Mar 2010 12:32:55 +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  8f08d8e282bf3d4917e94135e67ba17d738313ce (commit)
       via  c1cb19fe67f4c83f9232087ae03c178905d62b0d (commit)
       via  e1d437a5f7c311499a88dcdd4598d4991383df37 (commit)
       via  20b116a6350a479d2372e037a79a4c9a2e6700bc (commit)
      from  281bfe635874936073b3305c462626fa1b448fd6 (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=8f08d8e282bf3d4917e94135e67ba17d738313ce


commit 8f08d8e282bf3d4917e94135e67ba17d738313ce
Author: Norihirio Tanaka <address@hidden>
Date:   Thu Mar 25 10:38:13 2010 +0100

    grep: fix printing when -w is used and regex is needed for matching
    
    * NEWS: Document bugfix.
    * src/dfasearch.c (EGexecute): After assess_pattern_match len, is either
    invalid or end-beg; jump to success.
    * tests/Makefile.am (TESTS): Add new test.
    * tests/backref-word: New.

diff --git a/NEWS b/NEWS
index ba02186..a9acb82 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,9 @@ GNU grep NEWS                                    -*- outline 
-*-
   Character ranges would not work in single-byte character sets other
   than C (for example, ISO-8859-1 or KOI8-R).  [bug introduced in 2.6]
 
+  The output of grep was incorrect for whole-word (-w) matches if the
+  patterns included a backreference.
+
 ** Portability
 
   Avoid a link failure on Solaris 8.
diff --git a/src/dfasearch.c b/src/dfasearch.c
index a43f822..5e7234a 100644
--- a/src/dfasearch.c
+++ b/src/dfasearch.c
@@ -357,8 +357,7 @@ EGexecute (char const *buf, size_t size, size_t *match_size,
                {
                  /* Good enough for a non-exact match.
                     No need to look at further patterns, if any.  */
-                 beg = match;
-                 goto success_in_len;
+                 goto success;
                }
              if (match < best_match || (match == best_match && len > best_len))
                {
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 02db64c..59ed672 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -16,6 +16,7 @@
 
 TESTS =                                                \
   backref.sh                                   \
+  backref-word                                 \
   bre.sh                                       \
   case-fold-backref                            \
   case-fold-backslash-w                                \
diff --git a/tests/backref-word b/tests/backref-word
new file mode 100644
index 0000000..c40c628
--- /dev/null
+++ b/tests/backref-word
@@ -0,0 +1,16 @@
+#!/bin/sh
+# This would fail for grep-2.6
+: ${srcdir=.}
+. "$srcdir/init.sh"; path_prepend_ ../src
+
+printf 'foo foo bar\n'      > exp1 || framework_failure_
+fail=0
+
+for LOC in en_US.UTF-8 zh_CN $LOCALE_FR_UTF8; do
+  out=out1-$LOC
+  LC_ALL=$LOC grep -w '\(foo\) \1' exp1 > $out || fail=1
+  compare $out exp1 || fail=1
+done
+
+Exit $fail
+

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


commit 8f08d8e282bf3d4917e94135e67ba17d738313ce
Author: Norihirio Tanaka <address@hidden>
Date:   Thu Mar 25 10:38:13 2010 +0100

    grep: fix printing when -w is used and regex is needed for matching
    
    * NEWS: Document bugfix.
    * src/dfasearch.c (EGexecute): After assess_pattern_match len, is either
    invalid or end-beg; jump to success.
    * tests/Makefile.am (TESTS): Add new test.
    * tests/backref-word: New.

diff --git a/NEWS b/NEWS
index ba02186..a9acb82 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,9 @@ GNU grep NEWS                                    -*- outline 
-*-
   Character ranges would not work in single-byte character sets other
   than C (for example, ISO-8859-1 or KOI8-R).  [bug introduced in 2.6]
 
+  The output of grep was incorrect for whole-word (-w) matches if the
+  patterns included a backreference.
+
 ** Portability
 
   Avoid a link failure on Solaris 8.
diff --git a/src/dfasearch.c b/src/dfasearch.c
index a43f822..5e7234a 100644
--- a/src/dfasearch.c
+++ b/src/dfasearch.c
@@ -357,8 +357,7 @@ EGexecute (char const *buf, size_t size, size_t *match_size,
                {
                  /* Good enough for a non-exact match.
                     No need to look at further patterns, if any.  */
-                 beg = match;
-                 goto success_in_len;
+                 goto success;
                }
              if (match < best_match || (match == best_match && len > best_len))
                {
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 02db64c..59ed672 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -16,6 +16,7 @@
 
 TESTS =                                                \
   backref.sh                                   \
+  backref-word                                 \
   bre.sh                                       \
   case-fold-backref                            \
   case-fold-backslash-w                                \
diff --git a/tests/backref-word b/tests/backref-word
new file mode 100644
index 0000000..c40c628
--- /dev/null
+++ b/tests/backref-word
@@ -0,0 +1,16 @@
+#!/bin/sh
+# This would fail for grep-2.6
+: ${srcdir=.}
+. "$srcdir/init.sh"; path_prepend_ ../src
+
+printf 'foo foo bar\n'      > exp1 || framework_failure_
+fail=0
+
+for LOC in en_US.UTF-8 zh_CN $LOCALE_FR_UTF8; do
+  out=out1-$LOC
+  LC_ALL=$LOC grep -w '\(foo\) \1' exp1 > $out || fail=1
+  compare $out exp1 || fail=1
+done
+
+Exit $fail
+

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


commit 8f08d8e282bf3d4917e94135e67ba17d738313ce
Author: Norihirio Tanaka <address@hidden>
Date:   Thu Mar 25 10:38:13 2010 +0100

    grep: fix printing when -w is used and regex is needed for matching
    
    * NEWS: Document bugfix.
    * src/dfasearch.c (EGexecute): After assess_pattern_match len, is either
    invalid or end-beg; jump to success.
    * tests/Makefile.am (TESTS): Add new test.
    * tests/backref-word: New.

diff --git a/NEWS b/NEWS
index ba02186..a9acb82 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,9 @@ GNU grep NEWS                                    -*- outline 
-*-
   Character ranges would not work in single-byte character sets other
   than C (for example, ISO-8859-1 or KOI8-R).  [bug introduced in 2.6]
 
+  The output of grep was incorrect for whole-word (-w) matches if the
+  patterns included a backreference.
+
 ** Portability
 
   Avoid a link failure on Solaris 8.
diff --git a/src/dfasearch.c b/src/dfasearch.c
index a43f822..5e7234a 100644
--- a/src/dfasearch.c
+++ b/src/dfasearch.c
@@ -357,8 +357,7 @@ EGexecute (char const *buf, size_t size, size_t *match_size,
                {
                  /* Good enough for a non-exact match.
                     No need to look at further patterns, if any.  */
-                 beg = match;
-                 goto success_in_len;
+                 goto success;
                }
              if (match < best_match || (match == best_match && len > best_len))
                {
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 02db64c..59ed672 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -16,6 +16,7 @@
 
 TESTS =                                                \
   backref.sh                                   \
+  backref-word                                 \
   bre.sh                                       \
   case-fold-backref                            \
   case-fold-backslash-w                                \
diff --git a/tests/backref-word b/tests/backref-word
new file mode 100644
index 0000000..c40c628
--- /dev/null
+++ b/tests/backref-word
@@ -0,0 +1,16 @@
+#!/bin/sh
+# This would fail for grep-2.6
+: ${srcdir=.}
+. "$srcdir/init.sh"; path_prepend_ ../src
+
+printf 'foo foo bar\n'      > exp1 || framework_failure_
+fail=0
+
+for LOC in en_US.UTF-8 zh_CN $LOCALE_FR_UTF8; do
+  out=out1-$LOC
+  LC_ALL=$LOC grep -w '\(foo\) \1' exp1 > $out || fail=1
+  compare $out exp1 || fail=1
+done
+
+Exit $fail
+

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


commit 8f08d8e282bf3d4917e94135e67ba17d738313ce
Author: Norihirio Tanaka <address@hidden>
Date:   Thu Mar 25 10:38:13 2010 +0100

    grep: fix printing when -w is used and regex is needed for matching
    
    * NEWS: Document bugfix.
    * src/dfasearch.c (EGexecute): After assess_pattern_match len, is either
    invalid or end-beg; jump to success.
    * tests/Makefile.am (TESTS): Add new test.
    * tests/backref-word: New.

diff --git a/NEWS b/NEWS
index ba02186..a9acb82 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,9 @@ GNU grep NEWS                                    -*- outline 
-*-
   Character ranges would not work in single-byte character sets other
   than C (for example, ISO-8859-1 or KOI8-R).  [bug introduced in 2.6]
 
+  The output of grep was incorrect for whole-word (-w) matches if the
+  patterns included a backreference.
+
 ** Portability
 
   Avoid a link failure on Solaris 8.
diff --git a/src/dfasearch.c b/src/dfasearch.c
index a43f822..5e7234a 100644
--- a/src/dfasearch.c
+++ b/src/dfasearch.c
@@ -357,8 +357,7 @@ EGexecute (char const *buf, size_t size, size_t *match_size,
                {
                  /* Good enough for a non-exact match.
                     No need to look at further patterns, if any.  */
-                 beg = match;
-                 goto success_in_len;
+                 goto success;
                }
              if (match < best_match || (match == best_match && len > best_len))
                {
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 02db64c..59ed672 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -16,6 +16,7 @@
 
 TESTS =                                                \
   backref.sh                                   \
+  backref-word                                 \
   bre.sh                                       \
   case-fold-backref                            \
   case-fold-backslash-w                                \
diff --git a/tests/backref-word b/tests/backref-word
new file mode 100644
index 0000000..c40c628
--- /dev/null
+++ b/tests/backref-word
@@ -0,0 +1,16 @@
+#!/bin/sh
+# This would fail for grep-2.6
+: ${srcdir=.}
+. "$srcdir/init.sh"; path_prepend_ ../src
+
+printf 'foo foo bar\n'      > exp1 || framework_failure_
+fail=0
+
+for LOC in en_US.UTF-8 zh_CN $LOCALE_FR_UTF8; do
+  out=out1-$LOC
+  LC_ALL=$LOC grep -w '\(foo\) \1' exp1 > $out || fail=1
+  compare $out exp1 || fail=1
+done
+
+Exit $fail
+

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

Summary of changes:
 NEWS                      |    6 ++++++
 THANKS                    |    1 +
 src/dfa.c                 |    2 +-
 src/dfasearch.c           |    3 +--
 src/main.c                |   14 +++++++++-----
 src/searchutils.c         |    1 +
 tests/Makefile.am         |    1 +
 tests/backref-word        |   16 ++++++++++++++++
 tests/spencer1-locale.awk |    2 ++
 9 files changed, 38 insertions(+), 8 deletions(-)
 create mode 100644 tests/backref-word


hooks/post-receive
-- 
grep




reply via email to

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