bug-grep
[Top][All Lists]
Advanced

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

bug#21486: [PATCH 3/3] dfa: cache transition from a state with dot expre


From: Norihiro Tanaka
Subject: bug#21486: [PATCH 3/3] dfa: cache transition from a state with dot expression in non-UTF8 multibyte locales
Date: Tue, 16 Aug 2016 23:27:30 +0900

On Tue, 16 Aug 2016 00:51:52 -0700
Paul Eggert <address@hidden> wrote:

> Thanks for writing that patch. I installed it in grep master (after
> tweaking the commit message a bit) and am marking this bug report as
> done.
> 
> I noticed what appears to be a problem in the patch, in the code:
> 
>    d->mb_trans[s][mb_index & ~0] = state;
> 
> I expect the "0" was intended to be a "1". I attempted to fix this by
> installing the attached patch 1, using + rather than & and |, as this
> was easier for me to follow and is likely a tiny bit faster anyway.
> 
> I also installed the attached patch 2, which ports the resulting
> dfa.c to C90; as I understand it Gawk still needs this.
> 
> I also installed the attached patch 3, which does some minor
> refactoring and cleanup and commentary fixes. As you can see, I am a
> fan of Leibniz-style comparison (preferring < to > and <= to >=).
> 
> Thanks again for the patch.

Thanks for reviewing and adjusting.

> I noticed what appears to be a problem in the patch, in the code:
> 
>    d->mb_trans[s][mb_index & ~0] = state;
> 
> I expect the "0" was intended to be a "1". I attempted to fix this by
> installing the attached patch 1, using + rather than & and |, as this
> was easier for me to follow and is likely a tiny bit faster anyway.

You are right.  It should be a "1".

> I also installed the attached patch 2, which ports the resulting
> dfa.c to C90; as I understand it Gawk still needs this.

Ah, I did not consider it.






reply via email to

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