Mercurial > vim
changeset 5360:71e92a1cb37d v7.4.032
updated for version 7.4.032
Problem: NFA engine does not match the NUL character. (Jonathon Merz)
Solution: Ues 0x0a instead of NUL. (Christian Brabandt)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sun, 22 Sep 2013 13:57:24 +0200 |
parents | 53cd90707ec6 |
children | f0a6eb929df1 |
files | src/regexp_nfa.c src/testdir/test64.in src/testdir/test64.ok src/version.c |
diffstat | 4 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/regexp_nfa.c +++ b/src/regexp_nfa.c @@ -1383,8 +1383,9 @@ nfa_regatom() EMSG2_RET_FAIL( _("E678: Invalid character after %s%%[dxouU]"), reg_magic == MAGIC_ALL); + /* A NUL is stored in the text as NL */ /* TODO: what if a composing character follows? */ - EMIT(nr); + EMIT(nr == 0 ? 0x0a : nr); } break;
--- a/src/testdir/test64.in +++ b/src/testdir/test64.in @@ -373,6 +373,7 @@ STARTTEST :call add(tl, [2, '\%x20', 'yes no', ' ']) :call add(tl, [2, '\%u0020', 'yes no', ' ']) :call add(tl, [2, '\%U00000020', 'yes no', ' ']) +:call add(tl, [2, '\%d0', "yes\x0ano", "\x0a"]) :" :""""" \%[abc] :call add(tl, [2, 'foo\%[bar]', 'fobar'])