grep-commit
[Top][All Lists]
Advanced

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

grep branch, master, updated. v2.20-58-g0406d13


From: Jim Meyering
Subject: grep branch, master, updated. v2.20-58-g0406d13
Date: Tue, 07 Oct 2014 15:43:28 +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  0406d130b73a2af380f41223014323323b9554d7 (commit)
      from  01d9f718410b583ab17d5e0e14d1f9e31fd878ba (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=0406d130b73a2af380f41223014323323b9554d7


commit 0406d130b73a2af380f41223014323323b9554d7
Author: Norihiro Tanaka <address@hidden>
Date:   Sun Oct 5 20:57:32 2014 -0700

    dfa: test for just-fixed bug
    
    * tests/mb-dot-newline: New file.
    * tests/Makefile.am (TESTS): Add it.
    * NEWS (Bug fixes): Mention it.
    Bisection suggests that the bug was introduced by
    commit v2.18-123-geb3292b.  Also see
    http://debbugs.gnu.org/cgi/bugreport.cgi?msg=17;bug=18580

diff --git a/NEWS b/NEWS
index a146e9e..07a5d54 100644
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,23 @@ GNU grep NEWS                                    -*- outline 
-*-
 
 ** Bug fixes
 
+  grep would fail to count newlines internally when operating in non-UTF8
+  multibyte locales, leading it to print potentially many lines that did
+  not match.  E.g., the command, "seq 10 | env LC_ALL=zh_CN src/grep -n .."
+  would print this:
+  1:1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+  10
+  implying that the match, "10" was on line 1.
+  [bug introduced in grep-2.19]
+
   grep -E rejected unmatched ')', instead of treating it like '\)'.
   [bug present since "the beginning"]
 
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 4b9a931..c298835 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -75,6 +75,7 @@ TESTS =                                               \
   long-line-vs-2GiB-read                       \
   max-count-overread                           \
   max-count-vs-context                         \
+  mb-dot-newline                               \
   mb-non-UTF8-overrun                          \
   mb-non-UTF8-performance                      \
   multibyte-white-space                                \
diff --git a/tests/mb-dot-newline b/tests/mb-dot-newline
new file mode 100755
index 0000000..5fab82b
--- /dev/null
+++ b/tests/mb-dot-newline
@@ -0,0 +1,33 @@
+#!/bin/sh
+# Trigger a bug in the DFA matcher.
+# This would fail for grep-2.20.
+
+# Copyright 2014 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+printf 'a\naa\n' > in || framework_failure_
+printf 'aa\n' > exp || framework_failure_
+
+fail=0
+
+for LOC in en_US.UTF-8 en_US zh_CN $LOCALE_FR_UTF8 C; do
+  out1=out1-$LOC
+  LC_ALL=$LOC grep '..' in > out || fail=1
+  compare exp out || fail=1
+done
+
+Exit $fail

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

Summary of changes:
 NEWS                                          |   17 +++++++++++++++++
 tests/Makefile.am                             |    1 +
 tests/{mb-non-UTF8-overrun => mb-dot-newline} |   17 ++++++++++-------
 3 files changed, 28 insertions(+), 7 deletions(-)
 copy tests/{mb-non-UTF8-overrun => mb-dot-newline} (71%)


hooks/post-receive
-- 
grep



reply via email to

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