Mercurial > vim
diff src/regexp_bt.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_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) {