bug-grep
[Top][All Lists]
Advanced

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

Re: Boyer Moore overflow patch


From: Charles Levert
Subject: Re: Boyer Moore overflow patch
Date: Tue, 14 Jun 2005 22:19:26 -0400
User-agent: Mutt/1.4.1i

* On Wednesday 2005-06-15 at 01:45:10 +0100, Julian Foad wrote:
> 
> diff -u -3 -p -d -r1.8 foad1.sh

The following patch should be equivalent and
much more readable.

I haven't looked at the rest yet, so I can't
vouch for the validity of the tests themselves,
regardless of how they're scripted.

I noticed there's a problem with LC_ALL still
being set to $u from above, which it shouldn't
be.  I'll have to investigate that separately.



--- tests/foad1.sh      2005-06-14 09:42:17 -0400
+++ tests/foad1.sh      2005-06-14 21:55:48 -0400
@@ -140,4 +140,18 @@
 fi
 
 
+# Test for Boyer-Moore bugs.  Thanks to Steve Summit for reporting the bug
+# and providing a test case which inspired these.
+b17='bbbbbbbbbbbbbbbbb'
+b85="$b17$b17$b17$b17$b17"
+b255="$b85$b85$b85"
+x16='xxxxxxxxxxxxxxxx'
+x64="$x16$x16$x16$x16"
+x256="$x64$x64$x64$x64"
+bm="cbbba${b255}c"
+grep_test "a${b255}a" "" "a${b255}b"
+grep_test "${x256}${bm}${x16}xx" "${x256}${bm}${x16}xx/" "$bm"
+unset b17 b85 b255 x16 x64 x256 bm
+
+
 exit $failures




reply via email to

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