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