From 72bb10df1fb3eb69bc91f5babfb8881ce098cba1 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 5 Apr 2022 14:00:32 +0100 Subject: patch 8.2.4693: new regexp does not accept pattern "\%>0v" Problem: new regexp does not accept pattern "\%>0v". Solution: Do accept digit zero. --- src/regexp_bt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/regexp_bt.c') diff --git a/src/regexp_bt.c b/src/regexp_bt.c index 0b3487fa0..18bad8054 100644 --- a/src/regexp_bt.c +++ b/src/regexp_bt.c @@ -1617,6 +1617,7 @@ regatom(int *flagp) long_u n = 0; int cmp; int cur = FALSE; + int got_digit = FALSE; cmp = c; if (cmp == '<' || cmp == '>') @@ -1628,6 +1629,7 @@ regatom(int *flagp) } while (VIM_ISDIGIT(c)) { + got_digit = TRUE; n = n * 10 + (c - '0'); c = getchr(); } @@ -1645,7 +1647,8 @@ regatom(int *flagp) } break; } - else if (c == 'l' || c == 'c' || c == 'v') + else if ((c == 'l' || c == 'c' || c == 'v') + && (cur || got_digit)) { if (cur && n) { -- cgit v1.2.1