summaryrefslogtreecommitdiffstats
path: root/patches/source/vim/patches/7.4.154
blob: db5ae62d63a2d616d7b6ce48d7e02a632cd2a677 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
To: vim_dev@googlegroups.com
Subject: Patch 7.4.154
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.4.154 (after 7.4.149)
Problem:    Still a problem with auto-loading.
Solution:   Pass no_autoload to deref_func_name(). (Yukihiro Nakadaira)
Files:	    src/eval.c


*** ../vim-7.4.153/src/eval.c	2014-01-14 16:36:40.000000000 +0100
--- src/eval.c	2014-01-14 19:40:36.000000000 +0100
***************
*** 447,453 ****
  #endif
  static int get_env_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate));
  static int find_internal_func __ARGS((char_u *name));
! static char_u *deref_func_name __ARGS((char_u *name, int *lenp));
  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));
  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));
  static void emsg_funcname __ARGS((char *ermsg, char_u *name));
--- 447,453 ----
  #endif
  static int get_env_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate));
  static int find_internal_func __ARGS((char_u *name));
! static char_u *deref_func_name __ARGS((char_u *name, int *lenp, int no_autoload));
  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));
  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));
  static void emsg_funcname __ARGS((char *ermsg, char_u *name));
***************
*** 3432,3438 ****
  
      /* If it is the name of a variable of type VAR_FUNC use its contents. */
      len = (int)STRLEN(tofree);
!     name = deref_func_name(tofree, &len);
  
      /* Skip white space to allow ":call func ()".  Not good, but required for
       * backward compatibility. */
--- 3432,3438 ----
  
      /* If it is the name of a variable of type VAR_FUNC use its contents. */
      len = (int)STRLEN(tofree);
!     name = deref_func_name(tofree, &len, FALSE);
  
      /* Skip white space to allow ":call func ()".  Not good, but required for
       * backward compatibility. */
***************
*** 5159,5165 ****
  	    {
  		/* If "s" is the name of a variable of type VAR_FUNC
  		 * use its contents. */
! 		s = deref_func_name(s, &len);
  
  		/* Invoke the function. */
  		ret = get_func_tv(s, len, rettv, arg,
--- 5159,5165 ----
  	    {
  		/* If "s" is the name of a variable of type VAR_FUNC
  		 * use its contents. */
! 		s = deref_func_name(s, &len, FALSE);
  
  		/* Invoke the function. */
  		ret = get_func_tv(s, len, rettv, arg,
***************
*** 8291,8306 ****
   * name it contains, otherwise return "name".
   */
      static char_u *
! deref_func_name(name, lenp)
      char_u	*name;
      int		*lenp;
  {
      dictitem_T	*v;
      int		cc;
  
      cc = name[*lenp];
      name[*lenp] = NUL;
!     v = find_var(name, NULL, FALSE);
      name[*lenp] = cc;
      if (v != NULL && v->di_tv.v_type == VAR_FUNC)
      {
--- 8291,8307 ----
   * name it contains, otherwise return "name".
   */
      static char_u *
! deref_func_name(name, lenp, no_autoload)
      char_u	*name;
      int		*lenp;
+     int		no_autoload;
  {
      dictitem_T	*v;
      int		cc;
  
      cc = name[*lenp];
      name[*lenp] = NUL;
!     v = find_var(name, NULL, no_autoload);
      name[*lenp] = cc;
      if (v != NULL && v->di_tv.v_type == VAR_FUNC)
      {
***************
*** 21947,21960 ****
      if (lv.ll_exp_name != NULL)
      {
  	len = (int)STRLEN(lv.ll_exp_name);
! 	name = deref_func_name(lv.ll_exp_name, &len);
  	if (name == lv.ll_exp_name)
  	    name = NULL;
      }
      else
      {
  	len = (int)(end - *pp);
! 	name = deref_func_name(*pp, &len);
  	if (name == *pp)
  	    name = NULL;
      }
--- 21948,21961 ----
      if (lv.ll_exp_name != NULL)
      {
  	len = (int)STRLEN(lv.ll_exp_name);
! 	name = deref_func_name(lv.ll_exp_name, &len, flags & TFN_NO_AUTOLOAD);
  	if (name == lv.ll_exp_name)
  	    name = NULL;
      }
      else
      {
  	len = (int)(end - *pp);
! 	name = deref_func_name(*pp, &len, flags & TFN_NO_AUTOLOAD);
  	if (name == *pp)
  	    name = NULL;
      }
*** ../vim-7.4.153/src/version.c	2014-01-14 19:35:49.000000000 +0100
--- src/version.c	2014-01-14 19:42:05.000000000 +0100
***************
*** 740,741 ****
--- 740,743 ----
  {   /* Add new patch number below this line */
+ /**/
+     154,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
162. You go outside and look for a brightness knob to turn down the sun.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///