From bad704fa0478c914e1089531bc61ac78009afaec Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 30 May 2013 11:51:08 +0200 Subject: [PATCH] updated for version 7.3.1055 Problem: Negated collection does not match newline. Solution: Handle newline differently. (Hiroshi Shirosaki) --- src/regexp_nfa.c | 15 ++++++++------- src/testdir/test64.in | 6 +++++- src/testdir/test64.ok | 6 ++++++ src/version.c | 2 ++ 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c index bb8c982fe..aa6c56e6a 100644 --- a/src/regexp_nfa.c +++ b/src/regexp_nfa.c @@ -1203,13 +1203,6 @@ collection: } mb_ptr_adv(regparse); - if (extra == ADD_NL) /* \_[] also matches \n */ - { - EMIT(reg_string ? NL : NFA_NEWL); - TRY_NEG(); - EMIT_GLUE(); - } - /* skip the trailing ] */ regparse = endp; mb_ptr_adv(regparse); @@ -1219,6 +1212,14 @@ collection: EMIT(NFA_END_NEG_RANGE); EMIT(NFA_CONCAT); } + + /* \_[] also matches \n but it's not negated */ + if (extra == ADD_NL) + { + EMIT(reg_string ? NL : NFA_NEWL); + EMIT(NFA_OR); + } + return OK; } /* if exists closing ] */ diff --git a/src/testdir/test64.in b/src/testdir/test64.in index 192d45672..0c5517316 100644 --- a/src/testdir/test64.in +++ b/src/testdir/test64.in @@ -344,9 +344,13 @@ STARTTEST :call add(tl, [0, '\(<<\)\@1<=span.', 'xxspanxxxx