diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2017-07-15 22:32:11 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2017-07-15 22:32:11 +0300 |
commit | 1ebf12cfe09b3d6b65704a7d6a1b05dfa375ed63 (patch) | |
tree | feccb8d8a743a0445c0ee4fada61966bb4728b51 /re.c | |
parent | 4dfba438f210317f2d85516d33faa208e70e4d5c (diff) | |
parent | 44cce0245a8113885ecedc34ac955aca6a021ca9 (diff) | |
download | egawk-1ebf12cfe09b3d6b65704a7d6a1b05dfa375ed63.tar.gz egawk-1ebf12cfe09b3d6b65704a7d6a1b05dfa375ed63.tar.bz2 egawk-1ebf12cfe09b3d6b65704a7d6a1b05dfa375ed63.zip |
Merge branch 'master' into feature/fix-comments
Diffstat (limited to 're.c')
-rw-r--r-- | re.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -268,17 +268,26 @@ research(Regexp *rp, char *str, int start, rp->pat.not_bol = 1; /* - * Always do dfa search if can; if it fails, we won't bother - * with the regex search. + * Always do dfa search if can; if it fails, then even if + * need_start is true, we won't bother with the regex search. * * The dfa matcher doesn't have a no_bol flag, so don't bother * trying it in that case. * + * 7/2008: Skip the dfa matcher if need_start. The dfa matcher + * has bugs in certain multibyte cases and it's too difficult + * to try to special case things. + * 7/2017: Apparently there are some cases where DFA gets + * stuck, even in the C locale, so we use dfa only if not need_start. + * + * Should that issue ever get resolved, note this comment: + * * 7/2016: The dfa matcher can't handle a case where searching * starts in the middle of a string, so don't bother trying it * in that case. + * if (rp->dfa && ! no_bol && start == 0) ... */ - if (rp->dfareg != NULL && ! no_bol && start == 0) { + if (rp->dfareg != NULL && ! no_bol && ! need_start) { struct dfa *superset = dfasuperset(rp->dfareg); if (superset) ret = dfaexec(superset, str+start, str+start+len, |