bug-grep
[Top][All Lists]
Advanced

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

Re: Boyer Moore overflow patch


From: Julian Foad
Subject: Re: Boyer Moore overflow patch
Date: Wed, 15 Jun 2005 11:40:42 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b) Gecko/20050217

Charles Levert wrote:
The following patch should be equivalent and
much more readable.

+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

Thanks - that is much better.

The "unset" at the end doesn't seem to be the usual practice, at least in this script, so I'm inclined to leave it out. Or else we should also unset "CB", "CE" and "u" after they are finished with.

- Julian




reply via email to

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