aboutsummaryrefslogtreecommitdiffstats
path: root/re.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-08-14 21:12:45 +0300
committerArnold D. Robbins <arnold@skeeve.com>2016-08-14 21:12:45 +0300
commit0bdf798b8f9d018b4d11f63dddde683248d65a39 (patch)
tree9247911e64755b056f9b91c93c9c7ea9e5357f77 /re.c
parentf591d307d9af95bfa0ccda4d5eb76a674447ba39 (diff)
parent0703039505200ca5126e11d905a6fa40c602d1b9 (diff)
downloadegawk-0bdf798b8f9d018b4d11f63dddde683248d65a39.tar.gz
egawk-0bdf798b8f9d018b4d11f63dddde683248d65a39.tar.bz2
egawk-0bdf798b8f9d018b4d11f63dddde683248d65a39.zip
Merge branch 'master' into feature/typed-regex
Diffstat (limited to 're.c')
-rw-r--r--re.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/re.c b/re.c
index d92560d0..20175024 100644
--- a/re.c
+++ b/re.c
@@ -203,10 +203,14 @@ make_regexp(const char *s, size_t len, bool ignorecase, bool dfa, bool canfatal)
syn &= ~RE_ICASE;
}
- dfa_syn = syn;
- if (ignorecase)
- dfa_syn |= RE_ICASE;
- dfasyntax(dfa_syn, ignorecase, '\n');
+ /* 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');
+ }
re_set_syntax(syn);
if ((rerr = re_compile_pattern(buf, len, &(rp->pat))) != NULL) {