diff options
Diffstat (limited to 'src/nvim/regexp_nfa.c')
-rw-r--r-- | src/nvim/regexp_nfa.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c index 2659eac762..60cdc12c92 100644 --- a/src/nvim/regexp_nfa.c +++ b/src/nvim/regexp_nfa.c @@ -1084,7 +1084,6 @@ static int nfa_regatom(void) int extra = 0; int emit_range; int negated; - int result; int startc = -1; int endc = -1; int oldstartc = -1; @@ -1259,10 +1258,16 @@ static int nfa_regatom(void) switch (c) { case 's': EMIT(NFA_ZSTART); + if (!re_mult_next("\\zs")) { + return false; + } break; case 'e': EMIT(NFA_ZEND); - nfa_has_zend = TRUE; + nfa_has_zend = true; + if (!re_mult_next("\\zs")) { + return false; + } break; case '1': case '2': @@ -1446,8 +1451,8 @@ collection: * recognize that [0-9] stands for \d and [A-Za-z_] for \h, * and perform the necessary substitutions in the NFA. */ - result = nfa_recognize_char_class(regparse, endp, - extra == NFA_ADD_NL); + int result = nfa_recognize_char_class(regparse, endp, + extra == NFA_ADD_NL); if (result != FAIL) { if (result >= NFA_FIRST_NL && result <= NFA_LAST_NL) { EMIT(result - NFA_ADD_NL); @@ -1551,7 +1556,6 @@ collection: /* Try equivalence class [=a=] and the like */ if (equiclass != 0) { nfa_emit_equi_class(equiclass); - result = OK; continue; } /* Try collating class like [. .] */ |