Re: [bug-grep] Boyer Moore overflow patch

2005-06-15 Thread Julian Foad
Paul Eggert wrote: Julian Foad <[EMAIL PROTECTED]> writes: +Moo that's not _that_ easy; you have to avoid an overflow. */ "Moo"? Heh! I also wondered what that was, and assumed it was some expression like the "Boy" in the previous sentence. I'll write my own version of that commen

Re: [bug-grep] Boyer Moore overflow patch

2005-06-15 Thread Tony Abou-Assaleh
> >for (i = 0; i < kwset->mind; ++i) > > - delta[(unsigned char) kwset->target[i]] = kwset->mind - (i + 1); > > + delta[(unsigned char) kwset->target[i]] = > > + MIN(kwset->mind - (i + 1), UCHAR_MAX); > > There should be a space after the "MIN". (This is the style > recommended by

Re: [bug-grep] Boyer Moore overflow patch

2005-06-14 Thread Paul Eggert
Julian Foad <[EMAIL PROTECTED]> writes: > + Moo that's not _that_ easy; you have to avoid an overflow. */ "Moo"? >for (i = 0; i < kwset->mind; ++i) > - delta[(unsigned char) kwset->target[i]] = kwset->mind - (i + 1); > + delta[(unsigned char) kwset->target[i]] = > + MI

Re: [bug-grep] Boyer Moore overflow patch

2005-06-14 Thread Julian Foad
I'm looking back at this post from 22 November 2004: Stepan Kasal wrote: some time ago I have created a patch to kwset.c, which fixes an overflow in the Boyer-Moore algorithm. According to our rules, I'm posting it here for review before I check it in. In a follow-up post, Stepan provided t