diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2014-12-10 22:12:46 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2014-12-10 22:12:46 +0200 |
commit | edfe2064ee8285ccc70b9254ed191d5cef1de14f (patch) | |
tree | a3ae3a048702a2da4367b8e24045e78c9e21671b /dfa.c | |
parent | c31c6405cf8bccde9ead3268ceebd0e5080ea632 (diff) | |
parent | 4518d0d3c80d8c616a8a7f65548fde4866495289 (diff) | |
download | egawk-edfe2064ee8285ccc70b9254ed191d5cef1de14f.tar.gz egawk-edfe2064ee8285ccc70b9254ed191d5cef1de14f.tar.bz2 egawk-edfe2064ee8285ccc70b9254ed191d5cef1de14f.zip |
Merge branch 'gawk-4.1-stable'
Diffstat (limited to 'dfa.c')
-rw-r--r-- | dfa.c | 39 |
1 files changed, 15 insertions, 24 deletions
@@ -3484,13 +3484,23 @@ dfaexec_main (struct dfa *d, char const *begin, char *end, } } - if ((char *) p > end) + if (s < 0) { - p = NULL; - goto done; + if ((char *) p > end || p[-1] != eol || d->newlines[s1] < 0) + { + p = NULL; + goto done; + } + + /* The previous character was a newline, count it, and skip + checking of multibyte character boundary until here. */ + nlcount++; + mbp = p; + + s = allow_nl ? d->newlines[s1] : 0; } - if (s >= 0 && d->fails[s]) + if (d->fails[s]) { if (d->success[s] & sbit[*p]) { @@ -3504,32 +3514,13 @@ dfaexec_main (struct dfa *d, char const *begin, char *end, State_transition(); else s = d->fails[s][*p++]; - continue; - } - - /* If the previous character was a newline, count it, and skip - checking of multibyte character boundary until here. */ - if (p[-1] == eol) - { - nlcount++; - mbp = p; } - - if (s >= 0) + else { if (!d->trans[s]) build_state (s, d); trans = d->trans; - continue; } - - if (p[-1] == eol && allow_nl) - { - s = d->newlines[s1]; - continue; - } - - s = 0; } done: |