Skip to content

Commit 91d6715

Browse files
committed
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)
1 parent c99b78c commit 91d6715

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

src/regexp_nfa.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1383,8 +1383,9 @@ nfa_regatom()
13831383
EMSG2_RET_FAIL(
13841384
_("E678: Invalid character after %s%%[dxouU]"),
13851385
reg_magic == MAGIC_ALL);
1386+
/* A NUL is stored in the text as NL */
13861387
/* TODO: what if a composing character follows? */
1387-
EMIT(nr);
1388+
EMIT(nr == 0 ? 0x0a : nr);
13881389
}
13891390
break;
13901391

src/testdir/test64.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ STARTTEST
373373
:call add(tl, [2, '\%x20', 'yes no', ' '])
374374
:call add(tl, [2, '\%u0020', 'yes no', ' '])
375375
:call add(tl, [2, '\%U00000020', 'yes no', ' '])
376+
:call add(tl, [2, '\%d0', "yes\x0ano", "\x0a"])
376377
:"
377378
:""""" \%[abc]
378379
:call add(tl, [2, 'foo\%[bar]', 'fobar'])

src/testdir/test64.ok

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,9 @@ OK 2 - \%u0020
863863
OK 0 - \%U00000020
864864
OK 1 - \%U00000020
865865
OK 2 - \%U00000020
866+
OK 0 - \%d0
867+
OK 1 - \%d0
868+
OK 2 - \%d0
866869
OK 0 - foo\%[bar]
867870
OK 1 - foo\%[bar]
868871
OK 2 - foo\%[bar]

src/version.c

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

739739
static int included_patches[] =
740740
{ /* Add new patch number below this line */
741+
/**/
742+
32,
741743
/**/
742744
31,
743745
/**/

0 commit comments

Comments
 (0)