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: Jim Meyering
Subject: Re: EGexecute: don't assume buffer ends in a newline
Date: Tue, 17 Aug 2010 18:51:32 +0200

Bruno Haible wrote:
> There was some fix in
> <http://git.savannah.gnu.org/gitweb/?p=grep.git;a=commitdiff;h=246dcbdb86292eb65d20ece05ecab823653e8411>
> to make Fexecute and EGexecute not assume that the buffer ends in a newline.
> As I understand, the 'grep' program does not need this, because it always
> ensures the buffer ends in a newline, but the librarified version may need
> it.
>
> This patch is incomplete: It still uses 'end - 1' even when end[-1] is not a
> newline.
>
> I noticed this because in GNU gettext, I've now disabled the dfa and kwset
> optimization, and the regular expression "error" is now reported as _not_
> matching the buffer "Unknown system error" (but the regular expression
> "erro" is!). The reason is that 'end' gets positioned to the end of that
> string, and the code uses 'end - 1' in an attempt to eliminate the newline
> that is not present.
>
> This fixes it for me, and causes no regressions in grep's testsuite.
>
> For your review. I don't have write access to the 'grep' repository, but
> have a copyright assignment for 'grep' in place.
>
>
> 2010-05-23  Bruno Haible  <address@hidden>
>
>       EGexecute: Don't assume the buffer ends in a newline.
>       * src/dfasearch.c (EGexecute): Don't ignore the last byte of the buffer
>       if it is not a newline.

Hi Bruno,

Thanks for the patch!
I'm finally getting to some of the grep backlog
and tried to apply this.  It's been so long that it
no longer applies due to changes in dfasearch.c.

Would you please update the patch?



reply via email to

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