comparison src/regexp_nfa.c @ 28325:a3a760ee765f v8.2.4688

patch 8.2.4688: new regexp engine does not give an error for "%v" Commit: https://github.com/vim/vim/commit/91ff3d4f52a55a7c37a52aaad524cd9dd12efae4 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Apr 4 18:32:32 2022 +0100 patch 8.2.4688: new regexp engine does not give an error for "\%v" Problem: New regexp engine does not give an error for "\%v". Solution: Check for a value argument. (issue https://github.com/vim/vim/issues/10079)
author Bram Moolenaar <Bram@vim.org>
date Mon, 04 Apr 2022 19:45:04 +0200
parents f70015784777
children 786707ef91de
comparison
equal deleted inserted replaced
28324:8b0d6c2190c0 28325:a3a760ee765f
1652 { 1652 {
1653 long_u tmp; 1653 long_u tmp;
1654 1654
1655 if (cur) 1655 if (cur)
1656 { 1656 {
1657 semsg(_(e_regexp_number_after_dot_pos_search), 1657 semsg(_(e_regexp_number_after_dot_pos_search_chr),
1658 no_Magic(c)); 1658 no_Magic(c));
1659 return FAIL; 1659 return FAIL;
1660 } 1660 }
1661 tmp = n * 10 + (c - '0'); 1661 tmp = n * 10 + (c - '0');
1662 1662
1671 } 1671 }
1672 if (c == 'l' || c == 'c' || c == 'v') 1672 if (c == 'l' || c == 'c' || c == 'v')
1673 { 1673 {
1674 long_u limit = INT_MAX; 1674 long_u limit = INT_MAX;
1675 1675
1676 if (!cur && n == 0)
1677 {
1678 semsg(_(e_nfa_regexp_missing_value_in_chr),
1679 no_Magic(c));
1680 return FAIL;
1681 }
1676 if (c == 'l') 1682 if (c == 'l')
1677 { 1683 {
1678 if (cur) 1684 if (cur)
1679 n = curwin->w_cursor.lnum; 1685 n = curwin->w_cursor.lnum;
1680 // \%{n}l \%{n}<l \%{n}>l 1686 // \%{n}l \%{n}<l \%{n}>l