Skip to content

Commit 308f3c5

Browse files
committed
updated for version 7.4.002
Problem: Pattern with two alternative look-behind matches does not match. (Amadeus Demarzi) Solution: When comparing PIMs also compare their state ID to see if they are different.
1 parent d3e0994 commit 308f3c5

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

src/regexp_nfa.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3782,6 +3782,9 @@ pim_equal(one, two)
37823782
if (two_unused)
37833783
/* one is used and two is not: not equal */
37843784
return FALSE;
3785+
/* compare the state id */
3786+
if (one->state->id != two->state->id)
3787+
return FALSE;
37853788
/* compare the position */
37863789
if (REG_MULTI)
37873790
return one->end.pos.lnum == two->end.pos.lnum

src/testdir/test64.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,9 @@ STARTTEST
421421
:call add(tl, [2, '\(foo\)\@<=\>', 'barfoo', '', 'foo'])
422422
:call add(tl, [2, '\(foo\)\@<=.*', 'foobar', 'bar', 'foo'])
423423
:"
424+
:" complicated look-behind match
425+
:call add(tl, [2, '\(r\@<=\|\w\@<!\)\/', 'x = /word/;', '/'])
426+
:"
424427
:""""" \@>
425428
:call add(tl, [2, '\(a*\)\@>a', 'aaaa'])
426429
:call add(tl, [2, '\(a*\)\@>b', 'aaab', 'aaab', 'aaa'])

src/testdir/test64.ok

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,9 @@ OK 2 - \(foo\)\@<=\>
974974
OK 0 - \(foo\)\@<=.*
975975
OK 1 - \(foo\)\@<=.*
976976
OK 2 - \(foo\)\@<=.*
977+
OK 0 - \(r\@<=\|\w\@<!\)\/
978+
OK 1 - \(r\@<=\|\w\@<!\)\/
979+
OK 2 - \(r\@<=\|\w\@<!\)\/
977980
OK 0 - \(a*\)\@>a
978981
OK 1 - \(a*\)\@>a
979982
OK 2 - \(a*\)\@>a

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,8 @@ static char *(features[]) =
727727

728728
static int included_patches[] =
729729
{ /* Add new patch number below this line */
730+
/**/
731+
2,
730732
/**/
731733
1,
732734
/**/

0 commit comments

Comments
 (0)