diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2014-12-10 22:13:17 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2014-12-10 22:13:17 +0200 |
commit | 3a19aae5768c877d02bd9149ec7658fdf8551632 (patch) | |
tree | 983b77b34229731a976f6e2af9764c234e713756 | |
parent | 0b64dd8ffff784984a7634593be57ceb8e292b14 (diff) | |
parent | edfe2064ee8285ccc70b9254ed191d5cef1de14f (diff) | |
download | gawk-nolibtool.tar.gz |
Merge branch 'master' into nolibtoolnolibtool
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | dfa.c | 39 |
2 files changed, 19 insertions, 24 deletions
@@ -1,3 +1,7 @@ +2014-12-10 Arnold D. Robbins <arnold@skeeve.com> + + * dfa.c: Sync with GNU grep. + 2014-11-26 Arnold D. Robbins <arnold@skeeve.com> * builtin.c (do_sub): Improve wording of gensub warnings. @@ -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: |