comparison 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
comparison
equal deleted inserted replaced
28334:a72c164495e0 28335:786707ef91de
1615 || c == '\'' || c == '.') 1615 || c == '\'' || c == '.')
1616 { 1616 {
1617 long_u n = 0; 1617 long_u n = 0;
1618 int cmp; 1618 int cmp;
1619 int cur = FALSE; 1619 int cur = FALSE;
1620 int got_digit = FALSE;
1620 1621
1621 cmp = c; 1622 cmp = c;
1622 if (cmp == '<' || cmp == '>') 1623 if (cmp == '<' || cmp == '>')
1623 c = getchr(); 1624 c = getchr();
1624 if (no_Magic(c) == '.') 1625 if (no_Magic(c) == '.')
1626 cur = TRUE; 1627 cur = TRUE;
1627 c = getchr(); 1628 c = getchr();
1628 } 1629 }
1629 while (VIM_ISDIGIT(c)) 1630 while (VIM_ISDIGIT(c))
1630 { 1631 {
1632 got_digit = TRUE;
1631 n = n * 10 + (c - '0'); 1633 n = n * 10 + (c - '0');
1632 c = getchr(); 1634 c = getchr();
1633 } 1635 }
1634 if (c == '\'' && n == 0) 1636 if (c == '\'' && n == 0)
1635 { 1637 {
1643 *regcode++ = c; 1645 *regcode++ = c;
1644 *regcode++ = cmp; 1646 *regcode++ = cmp;
1645 } 1647 }
1646 break; 1648 break;
1647 } 1649 }
1648 else if (c == 'l' || c == 'c' || c == 'v') 1650 else if ((c == 'l' || c == 'c' || c == 'v')
1651 && (cur || got_digit))
1649 { 1652 {
1650 if (cur && n) 1653 if (cur && n)
1651 { 1654 {
1652 semsg(_(e_regexp_number_after_dot_pos_search_chr), 1655 semsg(_(e_regexp_number_after_dot_pos_search_chr),
1653 no_Magic(c)); 1656 no_Magic(c));