diff options
author | Bram Moolenaar <Bram@vim.org> | 2015-01-14 17:15:05 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2015-01-14 17:15:05 +0100 |
commit | 615b9978dd32345ccb9f9d2ae0fc2b451ab62ea4 (patch) | |
tree | bcf16fcb08aa1c8cabe037b0c60cdeda4c3f78d4 | |
parent | 5000869712f799d9ca25c0e45dc21d332edae5f4 (diff) |
updated for version 7.4.574v7.4.574
Problem: No error for eval('$').
Solution: Check for empty name. (Yasuhiro Matsumoto)
-rw-r--r-- | src/eval.c | 8 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/eval.c b/src/eval.c index fbe824eec1..50e87081f7 100644 --- a/src/eval.c +++ b/src/eval.c @@ -7867,7 +7867,7 @@ get_env_tv(arg, rettv, evaluate) if (evaluate) { if (len == 0) - return FAIL; /* can't be an environment variable */ + return FAIL; /* invalid empty name */ cc = name[len]; name[len] = NUL; @@ -10117,14 +10117,18 @@ f_eval(argvars, rettv) typval_T *argvars; typval_T *rettv; { - char_u *s; + char_u *s, *p; s = get_tv_string_chk(&argvars[0]); if (s != NULL) s = skipwhite(s); + p = s; if (s == NULL || eval1(&s, rettv, TRUE) == FAIL) { + if (p != NULL && !aborting()) + EMSG2(_(e_invexpr2), p); + need_clr_eos = FALSE; rettv->v_type = VAR_NUMBER; rettv->vval.v_number = 0; } diff --git a/src/version.c b/src/version.c index ed1a6e341c..51a1a1609b 100644 --- a/src/version.c +++ b/src/version.c @@ -742,6 +742,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 574, +/**/ 573, /**/ 572, |