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)
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 4c02e15..5631795 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -13199,7 +13199,8 @@
case 16: what = STR2NR_HEX + STR2NR_FORCE; break;
default: 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