mirror of
https://github.com/neovim/neovim.git
synced 2025-10-09 19:36:40 +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:
@@ -10030,7 +10030,8 @@ static void f_str2nr(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
what = 0;
|
||||
}
|
||||
}
|
||||
vim_str2nr(p, NULL, NULL, what, &n, NULL, 0);
|
||||
vim_str2nr(p, NULL, NULL, what, &n, NULL, 0, false);
|
||||
// Text after the number is silently ignored.
|
||||
if (isneg) {
|
||||
rettv->vval.v_number = -n;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user