073263
To: vim_dev@googlegroups.com
073263
Subject: Patch 7.4.574
073263
Fcc: outbox
073263
From: Bram Moolenaar <Bram@moolenaar.net>
073263
Mime-Version: 1.0
073263
Content-Type: text/plain; charset=UTF-8
073263
Content-Transfer-Encoding: 8bit
073263
------------
073263
073263
Patch 7.4.574
073263
Problem:    No error for eval('$').
073263
Solution:   Check for empty name. (Yasuhiro Matsumoto)
073263
Files:	    src/eval.c
073263
073263
073263
*** ../vim-7.4.573/src/eval.c	2014-12-13 21:00:52.059036480 +0100
073263
--- src/eval.c	2015-01-14 17:11:38.633570761 +0100
073263
***************
073263
*** 7867,7873 ****
073263
      if (evaluate)
073263
      {
073263
  	if (len == 0)
073263
!            return FAIL; /* can't be an environment variable */
073263
  
073263
  	cc = name[len];
073263
  	name[len] = NUL;
073263
--- 7867,7873 ----
073263
      if (evaluate)
073263
      {
073263
  	if (len == 0)
073263
! 	    return FAIL; /* invalid empty name */
073263
  
073263
  	cc = name[len];
073263
  	name[len] = NUL;
073263
***************
073263
*** 10117,10130 ****
073263
      typval_T	*argvars;
073263
      typval_T	*rettv;
073263
  {
073263
!     char_u	*s;
073263
  
073263
      s = get_tv_string_chk(&argvars[0]);
073263
      if (s != NULL)
073263
  	s = skipwhite(s);
073263
  
073263
      if (s == NULL || eval1(&s, rettv, TRUE) == FAIL)
073263
      {
073263
  	rettv->v_type = VAR_NUMBER;
073263
  	rettv->vval.v_number = 0;
073263
      }
073263
--- 10117,10134 ----
073263
      typval_T	*argvars;
073263
      typval_T	*rettv;
073263
  {
073263
!     char_u	*s, *p;
073263
  
073263
      s = get_tv_string_chk(&argvars[0]);
073263
      if (s != NULL)
073263
  	s = skipwhite(s);
073263
  
073263
+     p = s;
073263
      if (s == NULL || eval1(&s, rettv, TRUE) == FAIL)
073263
      {
073263
+ 	if (p != NULL && !aborting())
073263
+ 	    EMSG2(_(e_invexpr2), p);
073263
+ 	need_clr_eos = FALSE;
073263
  	rettv->v_type = VAR_NUMBER;
073263
  	rettv->vval.v_number = 0;
073263
      }
073263
*** ../vim-7.4.573/src/version.c	2015-01-14 16:08:29.210474234 +0100
073263
--- src/version.c	2015-01-14 17:05:25.357601603 +0100
073263
***************
073263
*** 743,744 ****
073263
--- 743,746 ----
073263
  {   /* Add new patch number below this line */
073263
+ /**/
073263
+     574,
073263
  /**/
073263
073263
-- 
073263
From "know your smileys":
073263
 :-)	Funny
073263
 |-)	Funny Oriental
073263
 (-:	Funny Australian
073263
073263
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
073263
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
073263
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
073263
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///