diff options
author | Bram Moolenaar <Bram@vim.org> | 2013-09-05 21:15:44 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2013-09-05 21:15:44 +0200 |
commit | 9be44818921a9255b3a26bf5566f1939bf38804e (patch) | |
tree | cd2a5c6c48160403089fd5f764b94c071ee7f96d /src/regexp_nfa.c | |
parent | 78c93e4b6a87720a50ac14c40aa077ed6b86145b (diff) | |
download | vim-git-9be44818921a9255b3a26bf5566f1939bf38804e.tar.gz |
updated for version 7.4.021v7.4.021
Problem: NFA regexp: Using \ze in one branch which doesn't match may cause
end of another branch to be wrong. (William Fugh)
Solution: Set end position if it wasn't set yet.
Diffstat (limited to 'src/regexp_nfa.c')
-rw-r--r-- | src/regexp_nfa.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c index fe1d02582..30aae8dcc 100644 --- a/src/regexp_nfa.c +++ b/src/regexp_nfa.c @@ -4209,10 +4209,11 @@ skip_add: break; case NFA_MCLOSE: - if (nfa_has_zend) + if (nfa_has_zend && (REG_MULTI + ? subs->norm.list.multi[0].end.lnum >= 0 + : subs->norm.list.line[0].end != NULL)) { - /* Do not overwrite the position set by \ze. If no \ze - * encountered end will be set in nfa_regtry(). */ + /* Do not overwrite the position set by \ze. */ subs = addstate(l, state->out, subs, pim, off); break; } |