mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
patch 8.1.1355: obvious mistakes are accepted as valid expressions
Problem: Obvious mistakes are accepted as valid expressions. Solution: Be more strict about parsing numbers. (Yasuhiro Matsumoto, closes #3981)
This commit is contained in:
@@ -6470,7 +6470,7 @@ get_list_range(char_u **str, int *num1, int *num2)
|
||||
*str = skipwhite(*str);
|
||||
if (**str == '-' || vim_isdigit(**str)) /* parse "from" part of range */
|
||||
{
|
||||
vim_str2nr(*str, NULL, &len, 0, &num, NULL, 0);
|
||||
vim_str2nr(*str, NULL, &len, 0, &num, NULL, 0, FALSE);
|
||||
*str += len;
|
||||
*num1 = (int)num;
|
||||
first = TRUE;
|
||||
@@ -6479,7 +6479,7 @@ get_list_range(char_u **str, int *num1, int *num2)
|
||||
if (**str == ',') /* parse "to" part of range */
|
||||
{
|
||||
*str = skipwhite(*str + 1);
|
||||
vim_str2nr(*str, NULL, &len, 0, &num, NULL, 0);
|
||||
vim_str2nr(*str, NULL, &len, 0, &num, NULL, 0, FALSE);
|
||||
if (len > 0)
|
||||
{
|
||||
*num2 = (int)num;
|
||||
|
Reference in New Issue
Block a user