1
0
forked from aniani/vim

updated for version 7.3.1026

Problem:    New regexp: pattern that includs a new-line matches too early.
            (john McGowan)
Solution:   Do not start searching in the second line.
This commit is contained in:
Bram Moolenaar
2013-05-26 18:40:14 +02:00
parent 61db8b5108
commit e23febdb85
4 changed files with 25 additions and 6 deletions

View File

@@ -3585,12 +3585,15 @@ nfa_regmatch(start, submatch, m)
} /* for (thislist = thislist; thislist->state; thislist++) */
/* The first found match is the leftmost one, but there may be a
* longer one. Keep running the NFA, but don't start from the
* beginning. Also, do not add the start state in recursive calls of
* nfa_regmatch(), because recursive calls should only start in the
* first position. */
if (match == FALSE && start->c == NFA_MOPEN + 0)
/* Look for the start of a match in the current position by adding the
* start state to the list of states.
* The first found match is the leftmost one, thus the order of states
* matters!
* Do not add the start state in recursive calls of nfa_regmatch(),
* because recursive calls should only start in the first position.
* Also don't start a match past the first line. */
if (match == FALSE && start->c == NFA_MOPEN + 0
&& reglnum == 0 && clen != 0)
{
#ifdef ENABLE_LOG
fprintf(log_fd, "(---) STARTSTATE\n");