Subject: Re: bug#23932: dfa: use algorithm for single byte character to any single byte character in input text always

From: Norihiro Tanaka <[email-masked]>
Date: Sat, 03 Sep 2016 10:27:40 +0900

On Thu, 1 Sep 2016 11:49:59 -0700
Paul Eggert <[email-masked]> wrote:

> Thanks for that set of patches too. I rebased it and tweaked NEWS and installed the resulting patch set (attached) into Savannah master.

Thanks for reviewing and installing.  BTW, I seem that you lost a part
of my proposition on rebase.  If it is not intentional, would you review
the part again?
From 392407bba36ee189a62af6b4a08c13476fa8fbbc Mon Sep 17 00:00:00 2001
From: Norihiro Tanaka <[email-masked]>
Date: Sat, 3 Sep 2016 10:11:56 +0900
Subject: [PATCH] dfa: additional change for use single-byte algorithm even in non-UTF-8

* src/dfa.c (dfaexec_main): Do it.
---
 src/dfa.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/src/dfa.c b/src/dfa.c
index e009bc6..e7b92ba 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -3183,10 +3183,7 @@ dfaexec_main (struct dfa *d, char const *begin, char *end, bool allow_nl,
 
           s1 = s;
           if (!multibyte || d->states[s].mbps.nelem == 0
-              || (*p == eol && !allow_nl)
-              || (*p == '\n' && !(d->syntax.syntax_bits & RE_DOT_NEWLINE))
-              || (*p == '\0' && (d->syntax.syntax_bits & RE_DOT_NOT_NULL))
-              || (char *) p >= end)
+              || d->localeinfo.sbctowc[*p] != WEOF || (char *) p >= end)
             {
               /* If a input character does not match ANYCHAR, do it
                  like a single-byte character.  */
-- 
1.7.1