On 09/15/2011 12:28 PM, Jim Meyering wrote:
diff --git a/src/dfa.c b/src/dfa.c
index dd8259c..f245208 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -2578,11 +2578,9 @@ dfastate (int s, struct dfa *d, int trans[])

        /* If we are building a searching matcher, throw in the positions
           of state 0 as well. */
-#if MBS_SUPPORT
-      if (d->searchflag&&  (d->mb_cur_max == 1 || !next_isnt_1st_byte))
-#else
-      if (d->searchflag)
-#endif
+      if (d->searchflag
+          &&  (! MBS_SUPPORT
+              || (d->mb_cur_max == 1 || !next_isnt_1st_byte)))

No need for the inner parentheses around the ||.

Or change it to

   && !( MBS_SUPPORT && d->mb_cur_max > 1 && next_isnt_1st_byte)

Alternatively, in patch 30 (dfa: simplify several expressions) just change it to

   if (d->searchflags && !next_isnt_1st_byte)

since next_isnt_1st_byte is always zero for single-byte character sets. Bonus points for reversing its direction to next_is_1st_byte. :)

Paolo

Reply via email to