lkundrak / rpms / vim

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