From 9b2cc2ba3a51f012d9006596811a867eb7846265 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 23 Aug 2016 05:48:38 +0300 Subject: Update dfa, including API changes. --- re.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 're.c') diff --git a/re.c b/re.c index 8a325308..878c884e 100644 --- a/re.c +++ b/re.c @@ -203,14 +203,11 @@ make_regexp(const char *s, size_t len, bool ignorecase, bool dfa, bool canfatal) syn &= ~RE_ICASE; } - /* only call dfasyntax if we're using dfa; saves time */ - if (dfa && ! no_dfa) { - dfa_syn = syn; - /* FIXME: dfa doesn't pay attention RE_ICASE */ - if (ignorecase) - dfa_syn |= RE_ICASE; - dfasyntax(dfa_syn, ignorecase, '\n'); - } + dfa_syn = syn; + /* FIXME: dfa doesn't pay attention RE_ICASE */ + if (ignorecase) + dfa_syn |= RE_ICASE; + re_set_syntax(syn); if ((rerr = re_compile_pattern(buf, len, &(rp->pat))) != NULL) { @@ -228,6 +225,7 @@ make_regexp(const char *s, size_t len, bool ignorecase, bool dfa, bool canfatal) if (dfa && ! no_dfa) { rp->dfa = true; rp->dfareg = dfaalloc(); + dfasyntax(rp->dfareg, dfa_syn, ignorecase, '\n'); dfacomp(buf, len, rp->dfareg, true); } else rp->dfa = false; @@ -423,7 +421,8 @@ resetup() syn |= RE_INTERVALS | RE_INVALID_INTERVAL_ORD | RE_NO_BK_BRACES; (void) re_set_syntax(syn); - dfasyntax(syn, false, '\n'); + + dfa_init(); } /* avoid_dfa --- return true if we should not use the DFA matcher */ -- cgit v1.2.3