grep-commit
[Top][All Lists]
Advanced

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

grep branch, master, updated. v2.11-4-gd0bb7f9


From: Jim Meyering
Subject: grep branch, master, updated. v2.11-4-gd0bb7f9
Date: Fri, 09 Mar 2012 11:34:44 +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  d0bb7f9c1505f08362dbf107d47d8d6795c93fbf (commit)
      from  4b2224681fbc297bf585630b679d8540a02b78d3 (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=d0bb7f9c1505f08362dbf107d47d8d6795c93fbf


commit d0bb7f9c1505f08362dbf107d47d8d6795c93fbf
Author: Jim Meyering <address@hidden>
Date:   Fri Mar 9 12:25:17 2012 +0100

    tests: exercise two recently-fixed bugs
    
    * tests/repetition-overflow: New test for bugs fixed by commit
    v2.10-82-gcbbc1a4.
    * tests/Makefile.am (TESTS): Add it.

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 0a22ba6..c2cd2f7 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -76,6 +76,7 @@ TESTS =                                               \
   pcre-z                                       \
   prefix-of-multibyte                          \
   r-dot                                                \
+  repetition-overflow                          \
   reversed-range-endpoints                     \
   sjis-mb                                      \
   spencer1                                     \
diff --git a/tests/repetition-overflow b/tests/repetition-overflow
new file mode 100755
index 0000000..c92de23
--- /dev/null
+++ b/tests/repetition-overflow
@@ -0,0 +1,19 @@
+#!/bin/sh
+# These would fail (i.e., match erroneously) prior to grep-2.11.
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+xp1=4294967297 # 2^32+1
+xp2=4294967298 # 2^32+2
+
+fail=0
+
+# Before grep-2.11, when DFA-matching, a repetition count exceeding the
+# range of "unsigned int" would silently wrap around.   Hence, 2^32+1
+# would be treated just like "1", and both of these would mistakenly match.
+
+echo abc  | grep -E "b{$xp1}"   > out 2>&1; test $? = 1 || fail=1
+compare out /dev/null || fail=1
+echo abbc | grep -E "b{1,$xp2}" > out 2>&1; test $? = 1 || fail=1
+compare out /dev/null || fail=1
+
+Exit $fail

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

Summary of changes:
 tests/Makefile.am         |    1 +
 tests/repetition-overflow |   19 +++++++++++++++++++
 2 files changed, 20 insertions(+), 0 deletions(-)
 create mode 100755 tests/repetition-overflow


hooks/post-receive
-- 
grep



reply via email to

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