diff src/regexp_nfa.c @ 28335:786707ef91de v8.2.4693

patch 8.2.4693: new regexp does not accept pattern "%>0v" Commit: https://github.com/vim/vim/commit/72bb10df1fb3eb69bc91f5babfb8881ce098cba1 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Apr 5 14:00:32 2022 +0100 patch 8.2.4693: new regexp does not accept pattern "\%>0v" Problem: new regexp does not accept pattern "\%>0v". Solution: Do accept digit zero.
author Bram Moolenaar <Bram@vim.org>
date Tue, 05 Apr 2022 15:15:04 +0200
parents a3a760ee765f
children e25196adb7c1
line wrap: on
line diff
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -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));