0
0
mirror of https://github.com/vim/vim.git synced 2025-09-28 04:24: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:
Bram Moolenaar
2019-05-19 19:59:35 +02:00
parent f5842c5a53
commit 16e9b85113
13 changed files with 86 additions and 28 deletions

View File

@@ -4762,10 +4762,10 @@ do_set(
/* Allow negative (for 'undolevels'), octal and
* hex numbers. */
vim_str2nr(arg, NULL, &i, STR2NR_ALL,
&value, NULL, 0);
if (arg[i] != NUL && !VIM_ISWHITE(arg[i]))
&value, NULL, 0, TRUE);
if (i == 0 || (arg[i] != NUL && !VIM_ISWHITE(arg[i])))
{
errmsg = e_invarg;
errmsg = N_("E521: Number required after =");
goto skip;
}
}