556859e
To: vim-dev@vim.org
556859e
Subject: Patch 7.2.402
556859e
Fcc: outbox
556859e
From: Bram Moolenaar <Bram@moolenaar.net>
556859e
Mime-Version: 1.0
556859e
Content-Type: text/plain; charset=UTF-8
556859e
Content-Transfer-Encoding: 8bit
556859e
------------
556859e
556859e
Patch 7.2.402
556859e
Problem:    This gives a #705 error: let X = function('haslocaldir')
556859e
	    let X = function('getcwd')
556859e
Solution:   Don't give E705 when the name is found in the hashtab. (Sergey
556859e
	    Khorev)
556859e
Files:	    src/eval.c
556859e
556859e
556859e
*** ../vim-7.2.401/src/eval.c	2010-03-10 13:43:22.000000000 +0100
556859e
--- src/eval.c	2010-03-17 19:35:01.000000000 +0100
556859e
***************
556859e
*** 19103,19108 ****
556859e
--- 19103,19116 ----
556859e
      hashtab_T	*ht;
556859e
      char_u	*p;
556859e
  
556859e
+     ht = find_var_ht(name, &varname);
556859e
+     if (ht == NULL || *varname == NUL)
556859e
+     {
556859e
+ 	EMSG2(_(e_illvar), name);
556859e
+ 	return;
556859e
+     }
556859e
+     v = find_var_in_ht(ht, varname, TRUE);
556859e
+ 
556859e
      if (tv->v_type == VAR_FUNC)
556859e
      {
556859e
  	if (!(vim_strchr((char_u *)"wbs", name[0]) != NULL && name[1] == ':')
556859e
***************
556859e
*** 19112,19118 ****
556859e
  	    EMSG2(_("E704: Funcref variable name must start with a capital: %s"), name);
556859e
  	    return;
556859e
  	}
556859e
! 	if (function_exists(name))
556859e
  	{
556859e
  	    EMSG2(_("E705: Variable name conflicts with existing function: %s"),
556859e
  									name);
556859e
--- 19120,19129 ----
556859e
  	    EMSG2(_("E704: Funcref variable name must start with a capital: %s"), name);
556859e
  	    return;
556859e
  	}
556859e
! 	/* Don't allow hiding a function.  When "v" is not NULL we migth be
556859e
! 	 * assigning another function to the same var, the type is checked
556859e
! 	 * below. */
556859e
! 	if (v == NULL && function_exists(name))
556859e
  	{
556859e
  	    EMSG2(_("E705: Variable name conflicts with existing function: %s"),
556859e
  									name);
556859e
***************
556859e
*** 19120,19133 ****
556859e
  	}
556859e
      }
556859e
  
556859e
-     ht = find_var_ht(name, &varname);
556859e
-     if (ht == NULL || *varname == NUL)
556859e
-     {
556859e
- 	EMSG2(_(e_illvar), name);
556859e
- 	return;
556859e
-     }
556859e
- 
556859e
-     v = find_var_in_ht(ht, varname, TRUE);
556859e
      if (v != NULL)
556859e
      {
556859e
  	/* existing variable, need to clear the value */
556859e
--- 19131,19136 ----
556859e
*** ../vim-7.2.401/src/version.c	2010-03-17 19:13:19.000000000 +0100
556859e
--- src/version.c	2010-03-17 19:36:09.000000000 +0100
556859e
***************
556859e
*** 683,684 ****
556859e
--- 683,686 ----
556859e
  {   /* Add new patch number below this line */
556859e
+ /**/
556859e
+     402,
556859e
  /**/
556859e
556859e
-- 
556859e
Michael: There is no such thing as a dump question.
556859e
Bernard: Sure there is.  For example "what is a core dump?"
556859e
556859e
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
556859e
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
556859e
\\\        download, build and distribute -- http://www.A-A-P.org        ///
556859e
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///