On Tue, 16 Aug 2016 00:51:52 -0700 Paul Eggert <egg...@cs.ucla.edu> 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.