3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.154
3ef2ca
Fcc: outbox
3ef2ca
From: Bram Moolenaar <Bram@moolenaar.net>
3ef2ca
Mime-Version: 1.0
3ef2ca
Content-Type: text/plain; charset=UTF-8
3ef2ca
Content-Transfer-Encoding: 8bit
3ef2ca
------------
3ef2ca
3ef2ca
Patch 7.4.154 (after 7.4.149)
3ef2ca
Problem:    Still a problem with auto-loading.
3ef2ca
Solution:   Pass no_autoload to deref_func_name(). (Yukihiro Nakadaira)
3ef2ca
Files:	    src/eval.c
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.153/src/eval.c	2014-01-14 16:36:40.000000000 +0100
3ef2ca
--- src/eval.c	2014-01-14 19:40:36.000000000 +0100
3ef2ca
***************
3ef2ca
*** 447,453 ****
3ef2ca
  #endif
3ef2ca
  static int get_env_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate));
3ef2ca
  static int find_internal_func __ARGS((char_u *name));
3ef2ca
! static char_u *deref_func_name __ARGS((char_u *name, int *lenp));
3ef2ca
  static int get_func_tv __ARGS((char_u *name, int len, typval_T *rettv, char_u **arg, linenr_T firstline, linenr_T lastline, int *doesrange, int evaluate, dict_T *selfdict));
3ef2ca
  static int call_func __ARGS((char_u *funcname, int len, typval_T *rettv, int argcount, typval_T *argvars, linenr_T firstline, linenr_T lastline, int *doesrange, int evaluate, dict_T *selfdict));
3ef2ca
  static void emsg_funcname __ARGS((char *ermsg, char_u *name));
3ef2ca
--- 447,453 ----
3ef2ca
  #endif
3ef2ca
  static int get_env_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate));
3ef2ca
  static int find_internal_func __ARGS((char_u *name));
3ef2ca
! static char_u *deref_func_name __ARGS((char_u *name, int *lenp, int no_autoload));
3ef2ca
  static int get_func_tv __ARGS((char_u *name, int len, typval_T *rettv, char_u **arg, linenr_T firstline, linenr_T lastline, int *doesrange, int evaluate, dict_T *selfdict));
3ef2ca
  static int call_func __ARGS((char_u *funcname, int len, typval_T *rettv, int argcount, typval_T *argvars, linenr_T firstline, linenr_T lastline, int *doesrange, int evaluate, dict_T *selfdict));
3ef2ca
  static void emsg_funcname __ARGS((char *ermsg, char_u *name));
3ef2ca
***************
3ef2ca
*** 3432,3438 ****
3ef2ca
  
3ef2ca
      /* If it is the name of a variable of type VAR_FUNC use its contents. */
3ef2ca
      len = (int)STRLEN(tofree);
3ef2ca
!     name = deref_func_name(tofree, &len;;
3ef2ca
  
3ef2ca
      /* Skip white space to allow ":call func ()".  Not good, but required for
3ef2ca
       * backward compatibility. */
3ef2ca
--- 3432,3438 ----
3ef2ca
  
3ef2ca
      /* If it is the name of a variable of type VAR_FUNC use its contents. */
3ef2ca
      len = (int)STRLEN(tofree);
3ef2ca
!     name = deref_func_name(tofree, &len, FALSE);
3ef2ca
  
3ef2ca
      /* Skip white space to allow ":call func ()".  Not good, but required for
3ef2ca
       * backward compatibility. */
3ef2ca
***************
3ef2ca
*** 5159,5165 ****
3ef2ca
  	    {
3ef2ca
  		/* If "s" is the name of a variable of type VAR_FUNC
3ef2ca
  		 * use its contents. */
3ef2ca
! 		s = deref_func_name(s, &len;;
3ef2ca
  
3ef2ca
  		/* Invoke the function. */
3ef2ca
  		ret = get_func_tv(s, len, rettv, arg,
3ef2ca
--- 5159,5165 ----
3ef2ca
  	    {
3ef2ca
  		/* If "s" is the name of a variable of type VAR_FUNC
3ef2ca
  		 * use its contents. */
3ef2ca
! 		s = deref_func_name(s, &len, FALSE);
3ef2ca
  
3ef2ca
  		/* Invoke the function. */
3ef2ca
  		ret = get_func_tv(s, len, rettv, arg,
3ef2ca
***************
3ef2ca
*** 8291,8306 ****
3ef2ca
   * name it contains, otherwise return "name".
3ef2ca
   */
3ef2ca
      static char_u *
3ef2ca
! deref_func_name(name, lenp)
3ef2ca
      char_u	*name;
3ef2ca
      int		*lenp;
3ef2ca
  {
3ef2ca
      dictitem_T	*v;
3ef2ca
      int		cc;
3ef2ca
  
3ef2ca
      cc = name[*lenp];
3ef2ca
      name[*lenp] = NUL;
3ef2ca
!     v = find_var(name, NULL, FALSE);
3ef2ca
      name[*lenp] = cc;
3ef2ca
      if (v != NULL && v->di_tv.v_type == VAR_FUNC)
3ef2ca
      {
3ef2ca
--- 8291,8307 ----
3ef2ca
   * name it contains, otherwise return "name".
3ef2ca
   */
3ef2ca
      static char_u *
3ef2ca
! deref_func_name(name, lenp, no_autoload)
3ef2ca
      char_u	*name;
3ef2ca
      int		*lenp;
3ef2ca
+     int		no_autoload;
3ef2ca
  {
3ef2ca
      dictitem_T	*v;
3ef2ca
      int		cc;
3ef2ca
  
3ef2ca
      cc = name[*lenp];
3ef2ca
      name[*lenp] = NUL;
3ef2ca
!     v = find_var(name, NULL, no_autoload);
3ef2ca
      name[*lenp] = cc;
3ef2ca
      if (v != NULL && v->di_tv.v_type == VAR_FUNC)
3ef2ca
      {
3ef2ca
***************
3ef2ca
*** 21947,21960 ****
3ef2ca
      if (lv.ll_exp_name != NULL)
3ef2ca
      {
3ef2ca
  	len = (int)STRLEN(lv.ll_exp_name);
3ef2ca
! 	name = deref_func_name(lv.ll_exp_name, &len;;
3ef2ca
  	if (name == lv.ll_exp_name)
3ef2ca
  	    name = NULL;
3ef2ca
      }
3ef2ca
      else
3ef2ca
      {
3ef2ca
  	len = (int)(end - *pp);
3ef2ca
! 	name = deref_func_name(*pp, &len;;
3ef2ca
  	if (name == *pp)
3ef2ca
  	    name = NULL;
3ef2ca
      }
3ef2ca
--- 21948,21961 ----
3ef2ca
      if (lv.ll_exp_name != NULL)
3ef2ca
      {
3ef2ca
  	len = (int)STRLEN(lv.ll_exp_name);
3ef2ca
! 	name = deref_func_name(lv.ll_exp_name, &len, flags & TFN_NO_AUTOLOAD);
3ef2ca
  	if (name == lv.ll_exp_name)
3ef2ca
  	    name = NULL;
3ef2ca
      }
3ef2ca
      else
3ef2ca
      {
3ef2ca
  	len = (int)(end - *pp);
3ef2ca
! 	name = deref_func_name(*pp, &len, flags & TFN_NO_AUTOLOAD);
3ef2ca
  	if (name == *pp)
3ef2ca
  	    name = NULL;
3ef2ca
      }
3ef2ca
*** ../vim-7.4.153/src/version.c	2014-01-14 19:35:49.000000000 +0100
3ef2ca
--- src/version.c	2014-01-14 19:42:05.000000000 +0100
3ef2ca
***************
3ef2ca
*** 740,741 ****
3ef2ca
--- 740,743 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     154,
3ef2ca
  /**/
3ef2ca
3ef2ca
-- 
3ef2ca
hundred-and-one symptoms of being an internet addict:
3ef2ca
162. You go outside and look for a brightness knob to turn down the sun.
3ef2ca
3ef2ca
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
3ef2ca
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
3ef2ca
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
3ef2ca
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///