summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-08-23 06:09:14 +0300
committerArnold D. Robbins <arnold@skeeve.com>2016-08-23 06:09:14 +0300
commitf0381a560523ce3559337ae62ca2b2ae4df93fac (patch)
tree9453c2596a68d11c0c2b52db5b781f7585ae8807 /re.c
parentba65577ec4dc7ece9772b2756d634aaaa352d504 (diff)
parent273c35356b59a2d3b989bd568f577aaf800dc4a5 (diff)
downloadgawk-f0381a560523ce3559337ae62ca2b2ae4df93fac.tar.gz
Merge branch 'master' into feature/typed-regex
Diffstat (limited to 're.c')
-rw-r--r--re.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/re.c b/re.c
index 20175024..a4a03904 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;
@@ -427,7 +425,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 */