On 05/24/2010 12:54 PM, Bruno Haible wrote:
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.

Right. That's violating ISO C's rule for validity of pointers though. In practice I don't think it matters, but I'd rather get a second opinion on this patch.

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.

Ah, okay, I didn't understand that.

Paolo

Reply via email to