diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/regexp_nfa.c | 16 | ||||
-rw-r--r-- | src/testdir/test95.in | 6 | ||||
-rw-r--r-- | src/testdir/test95.ok | 1 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 12 insertions, 13 deletions
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c index 157d3ebad..4f2b92540 100644 --- a/src/regexp_nfa.c +++ b/src/regexp_nfa.c @@ -2859,7 +2859,7 @@ nfa_regmatch(start, submatch, m) List *listtbl[2][2]; List *ll; int listid = 1; - int endnode = 0; + int endnode; List *thislist; List *nextlist; List *neglist; @@ -3192,13 +3192,7 @@ nfa_regmatch(start, submatch, m) case NFA_MULTIBYTE: case NFA_COMPOSING: - switch (t->state->c) - { - case NFA_MULTIBYTE: endnode = NFA_END_MULTIBYTE; break; - case NFA_COMPOSING: endnode = NFA_END_COMPOSING; break; - default: endnode = 0; - } - + endnode = t->state->c + 1; result = OK; sta = t->state->out; len = 1; @@ -3206,7 +3200,7 @@ nfa_regmatch(start, submatch, m) { if (reginput[len-1] != sta->c) { - result = OK - 1; + result = FAIL; break; } len++; @@ -3215,11 +3209,11 @@ nfa_regmatch(start, submatch, m) /* if input char length doesn't match regexp char length */ if (len -1 < n || sta->c != endnode) - result = OK - 1; + result = FAIL; end = t->state->out1; /* NFA_END_MULTIBYTE or NFA_END_COMPOSING */ /* If \Z was present, then ignore composing characters */ - if (regflags & RF_ICOMBINE) + if (ireg_icombine && endnode == NFA_END_COMPOSING) result = 1 ^ sta->negated; ADD_POS_NEG_STATE(end); break; diff --git a/src/testdir/test95.in b/src/testdir/test95.in index 41e3f78b2..e332b9708 100644 --- a/src/testdir/test95.in +++ b/src/testdir/test95.in @@ -7,7 +7,7 @@ actually tried. STARTTEST :so small.vim :so mbyte.vim -:set nocp encoding=utf-8 viminfo+=nviminfo +:set nocp encoding=utf-8 viminfo+=nviminfo nomore :" tl is a List of Lists with: :" regexp pattern :" text to test the pattern on @@ -35,11 +35,13 @@ STARTTEST :call add(tl, ['\f\+', '&*fname ', 'fname']) :call add(tl, ['\%#=1\f\+', '&*fname ', 'fname']) +:"""" Test \Z +:call add(tl, ['ú\Z', 'x']) + :"""" Combining different tests and features :call add(tl, ['[^[=a=]]\+', 'ddaãâbcd', 'dd']) :"""" Run the tests - :" :for t in tl : let l = matchlist(t[1], t[0]) diff --git a/src/testdir/test95.ok b/src/testdir/test95.ok index 4c1f0ca1d..23d228494 100644 --- a/src/testdir/test95.ok +++ b/src/testdir/test95.ok @@ -9,4 +9,5 @@ OK - \i\+ OK - \%#=1\i\+ OK - \f\+ OK - \%#=1\f\+ +OK - ú\Z OK - [^[=a=]]\+ diff --git a/src/version.c b/src/version.c index 8504dfe25..ffc138ec8 100644 --- a/src/version.c +++ b/src/version.c @@ -729,6 +729,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1010, +/**/ 1009, /**/ 1008, |