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