patch 8.2.4693: new regexp does not accept pattern "\%>0v"

Problem:    new regexp does not accept pattern "\%>0v".
Solution:   Do accept digit zero.
This commit is contained in:
Bram Moolenaar
2022-04-05 14:00:32 +01:00
parent 0f68e6c07a
commit 72bb10df1f
4 changed files with 23 additions and 3 deletions

View File

@ -1640,6 +1640,7 @@ nfa_regatom(void)
long_u n = 0;
int cmp = c;
int cur = FALSE;
int got_digit = FALSE;
if (c == '<' || c == '>')
c = getchr();
@ -1668,12 +1669,13 @@ nfa_regatom(void)
}
n = tmp;
c = getchr();
got_digit = TRUE;
}
if (c == 'l' || c == 'c' || c == 'v')
{
long_u limit = INT_MAX;
if (!cur && n == 0)
if (!cur && !got_digit)
{
semsg(_(e_nfa_regexp_missing_value_in_chr),
no_Magic(c));