bug-grep
[Top][All Lists]
Advanced

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

Re: EGexecute: don't assume buffer ends in a newline


From: Bruno Haible
Subject: Re: EGexecute: don't assume buffer ends in a newline
Date: Mon, 24 May 2010 12:54:21 +0200
User-agent: KMail/1.9.9

Hi Paolo,

> >         /* If we've made it to this point, this means DFA has seen
> >            a probable match, and we need to run it through Regex. */
> > -      best_match = end;
> > +      best_match = end + 1;
> 
> Shouldn't this be
> 
>    best_match = end + (end < buflim);
> 
> ?

No. You see that and the end of the search loop, there is a
    if (best_match < end)
that I turned into
    if (best_match <= end)
This statement is meant to detect whether a match has been found at all.
So, the initial value of best_match has to be greater than 'end' in all cases.

> Otherwise, the patch seems okay.  Are you going to patch Fexecute too?

You fixed Fexecute already. With msggrep and its use of buffers that don't
end in a newline, I did not detect a bug in Fexecute. Only in EGexecute.

Bruno



reply via email to

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