mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 16:28:17 +00:00
vim-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 vim/vim#3981)
16e9b85113
Update vim_str2nr_spec.lua to add more tests that use strict = true.
This commit is contained in:
@@ -3950,7 +3950,12 @@ static int eval7(
|
||||
rettv->vval.v_float = f;
|
||||
}
|
||||
} else {
|
||||
vim_str2nr(*arg, NULL, &len, STR2NR_ALL, &n, NULL, 0);
|
||||
vim_str2nr(*arg, NULL, &len, STR2NR_ALL, &n, NULL, 0, true);
|
||||
if (len == 0) {
|
||||
EMSG2(_(e_invexpr2), *arg);
|
||||
ret = FAIL;
|
||||
break;
|
||||
}
|
||||
*arg += len;
|
||||
if (evaluate) {
|
||||
rettv->v_type = VAR_NUMBER;
|
||||
|
Reference in New Issue
Block a user