aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r--src/nvim/eval.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index f291d9f302..8a98eae21f 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -6363,8 +6363,8 @@ static int get_env_tv(char_u **arg, typval_T *rettv, int evaluate)
len = get_env_len(arg);
if (evaluate) {
- if (len == 0) {
- return FAIL; // Can't be an environment variable.
+ if (len == 0) {
+ return FAIL; // Invalid empty name.
}
cc = name[len];
name[len] = NUL;
@@ -8145,11 +8145,17 @@ static void f_eval(typval_T *argvars, typval_T *rettv)
if (s != NULL)
s = skipwhite(s);
+ char_u *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;
- } else if (*s != NUL)
+ } else if (*s != NUL) {
EMSG(_(e_trailing));
+ }
}
/*