Bug#181378: grep hanging with -Fw and an empty pattern

2005-09-29 Thread Tim Waugh
On Wed, Sep 28, 2005 at 01:26:27PM +0200, Nicolas François wrote:

 Changing the 'while (1)' loop to a 'while (len)' loop in search.c fix this
 issue.  However, I don't know if this is correct or optimal (I don't know
 what should happen if we enter the loop with len0 and len is then
 decreased to 0; Maybe this should also be catched earlier).
 
 Does it seems correct to you ?

Yes, looks correct to me.  Thanks.

Tim.
*/


pgpE7Szebf6xu.pgp
Description: PGP signature


Bug#181378: grep hanging with -Fw and an empty pattern

2005-09-28 Thread Nicolas François
Hello,

Sorry for contacting you directly.

I'm trying to port you patch (grep-2.5.1-egf-speedup.patch) to Debian.
This patch triggered an issue when an empty pattern is used with the -Fw
options.
(see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=329876)

I tried the Fedora grep-2.5.1-48.2 binary, which suffers from the same
issue (on a Debian system, with a Debian libc and libpcre):
   echo foobar | grep -Fw 
hangs (this could appear with the -Fwf options when the patterns file
contains an empty line).

Changing the 'while (1)' loop to a 'while (len)' loop in search.c fix this
issue.  However, I don't know if this is correct or optimal (I don't know
what should happen if we enter the loop with len0 and len is then
decreased to 0; Maybe this should also be catched earlier).

Does it seems correct to you ?

Sorry I could not check if a Redhat system suffers from this (that's the
reson why I do not use the BTS) and thanks a lot for the impressive
speed-up of grep on an UTF-8 environment,
-- 
Nekral


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]