Skip to content

Commit

Permalink
updated for version 7.4.574
Browse files Browse the repository at this point in the history
Problem:    No error for eval('$').
Solution:   Check for empty name. (Yasuhiro Matsumoto)
  • Loading branch information
brammool committed Jan 14, 2015
1 parent 5b6cc8f commit 4d8d54c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
574,
/**/
573,
/**/
Expand Down

0 comments on commit 4d8d54c

Please sign in to comment.