summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0233
blob: 92eddef3bd30b3c1956be9ab86ff8dd10a54581d (plain)
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0233
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0233
Problem:    "safe" argument of call_vim_function() is always FALSE.
Solution:   Remove the argument.
Files:	    src/eval.c, src/proto/eval.pro, src/edit.c, src/mbyte.c,
            src/normal.c, src/ex_getln.c


*** ../vim-8.1.0232/src/eval.c	2018-07-25 21:19:09.359656999 +0200
--- src/eval.c	2018-08-01 19:01:56.055522006 +0200
***************
*** 1021,1049 ****
      char_u      *func,
      int		argc,
      typval_T	*argv,
!     typval_T	*rettv,
!     int		safe)		/* use the sandbox */
  {
      int		doesrange;
-     void	*save_funccalp = NULL;
      int		ret;
  
-     if (safe)
-     {
- 	save_funccalp = save_funccal();
- 	++sandbox;
-     }
- 
      rettv->v_type = VAR_UNKNOWN;		/* clear_tv() uses this */
      ret = call_func(func, (int)STRLEN(func), rettv, argc, argv, NULL,
  		    curwin->w_cursor.lnum, curwin->w_cursor.lnum,
  		    &doesrange, TRUE, NULL, NULL);
-     if (safe)
-     {
- 	--sandbox;
- 	restore_funccal(save_funccalp);
-     }
- 
      if (ret == FAIL)
  	clear_tv(rettv);
  
--- 1021,1035 ----
      char_u      *func,
      int		argc,
      typval_T	*argv,
!     typval_T	*rettv)
  {
      int		doesrange;
      int		ret;
  
      rettv->v_type = VAR_UNKNOWN;		/* clear_tv() uses this */
      ret = call_func(func, (int)STRLEN(func), rettv, argc, argv, NULL,
  		    curwin->w_cursor.lnum, curwin->w_cursor.lnum,
  		    &doesrange, TRUE, NULL, NULL);
      if (ret == FAIL)
  	clear_tv(rettv);
  
***************
*** 1060,1072 ****
  call_func_retnr(
      char_u      *func,
      int		argc,
!     typval_T	*argv,
!     int		safe)		/* use the sandbox */
  {
      typval_T	rettv;
      varnumber_T	retval;
  
!     if (call_vim_function(func, argc, argv, &rettv, safe) == FAIL)
  	return -1;
  
      retval = get_tv_number_chk(&rettv, NULL);
--- 1046,1057 ----
  call_func_retnr(
      char_u      *func,
      int		argc,
!     typval_T	*argv)
  {
      typval_T	rettv;
      varnumber_T	retval;
  
!     if (call_vim_function(func, argc, argv, &rettv) == FAIL)
  	return -1;
  
      retval = get_tv_number_chk(&rettv, NULL);
***************
*** 1088,1100 ****
  call_func_retstr(
      char_u      *func,
      int		argc,
!     typval_T	*argv,
!     int		safe)		/* use the sandbox */
  {
      typval_T	rettv;
      char_u	*retval;
  
!     if (call_vim_function(func, argc, argv, &rettv, safe) == FAIL)
  	return NULL;
  
      retval = vim_strsave(get_tv_string(&rettv));
--- 1073,1084 ----
  call_func_retstr(
      char_u      *func,
      int		argc,
!     typval_T	*argv)
  {
      typval_T	rettv;
      char_u	*retval;
  
!     if (call_vim_function(func, argc, argv, &rettv) == FAIL)
  	return NULL;
  
      retval = vim_strsave(get_tv_string(&rettv));
***************
*** 1113,1124 ****
  call_func_retlist(
      char_u      *func,
      int		argc,
!     typval_T	*argv,
!     int		safe)		/* use the sandbox */
  {
      typval_T	rettv;
  
!     if (call_vim_function(func, argc, argv, &rettv, safe) == FAIL)
  	return NULL;
  
      if (rettv.v_type != VAR_LIST)
--- 1097,1107 ----
  call_func_retlist(
      char_u      *func,
      int		argc,
!     typval_T	*argv)
  {
      typval_T	rettv;
  
!     if (call_vim_function(func, argc, argv, &rettv) == FAIL)
  	return NULL;
  
      if (rettv.v_type != VAR_LIST)
*** ../vim-8.1.0232/src/proto/eval.pro	2018-07-25 21:19:09.359656999 +0200
--- src/proto/eval.pro	2018-08-01 19:01:23.155692745 +0200
***************
*** 19,28 ****
  list_T *eval_spell_expr(char_u *badword, char_u *expr);
  int get_spellword(list_T *list, char_u **pp);
  typval_T *eval_expr(char_u *arg, char_u **nextcmd);
! int call_vim_function(char_u *func, int argc, typval_T *argv, typval_T *rettv, int safe);
! varnumber_T call_func_retnr(char_u *func, int argc, typval_T *argv, int safe);
! void *call_func_retstr(char_u *func, int argc, typval_T *argv, int safe);
! void *call_func_retlist(char_u *func, int argc, typval_T *argv, int safe);
  int eval_foldexpr(char_u *arg, int *cp);
  void ex_let(exarg_T *eap);
  void list_hashtable_vars(hashtab_T *ht, char_u *prefix, int empty, int *first);
--- 19,28 ----
  list_T *eval_spell_expr(char_u *badword, char_u *expr);
  int get_spellword(list_T *list, char_u **pp);
  typval_T *eval_expr(char_u *arg, char_u **nextcmd);
! int call_vim_function(char_u *func, int argc, typval_T *argv, typval_T *rettv);
! varnumber_T call_func_retnr(char_u *func, int argc, typval_T *argv);
! void *call_func_retstr(char_u *func, int argc, typval_T *argv);
! void *call_func_retlist(char_u *func, int argc, typval_T *argv);
  int eval_foldexpr(char_u *arg, int *cp);
  void ex_let(exarg_T *eap);
  void list_hashtable_vars(hashtab_T *ht, char_u *prefix, int empty, int *first);
*** ../vim-8.1.0232/src/edit.c	2018-07-29 16:09:14.632945629 +0200
--- src/edit.c	2018-08-01 19:00:45.703885362 +0200
***************
*** 4239,4245 ****
      curbuf_save = curbuf;
  
      /* Call a function, which returns a list or dict. */
!     if (call_vim_function(funcname, 2, args, &rettv, FALSE) == OK)
      {
  	switch (rettv.v_type)
  	{
--- 4239,4245 ----
      curbuf_save = curbuf;
  
      /* Call a function, which returns a list or dict. */
!     if (call_vim_function(funcname, 2, args, &rettv) == OK)
      {
  	switch (rettv.v_type)
  	{
***************
*** 5569,5575 ****
  	    pos = curwin->w_cursor;
  	    curwin_save = curwin;
  	    curbuf_save = curbuf;
! 	    col = call_func_retnr(funcname, 2, args, FALSE);
  	    if (curwin_save != curwin || curbuf_save != curbuf)
  	    {
  		EMSG(_(e_complwin));
--- 5569,5575 ----
  	    pos = curwin->w_cursor;
  	    curwin_save = curwin;
  	    curbuf_save = curbuf;
! 	    col = call_func_retnr(funcname, 2, args);
  	    if (curwin_save != curwin || curbuf_save != curbuf)
  	    {
  		EMSG(_(e_complwin));
*** ../vim-8.1.0232/src/mbyte.c	2018-07-14 19:30:32.320395535 +0200
--- src/mbyte.c	2018-08-01 18:58:55.524439870 +0200
***************
*** 4825,4831 ****
      argv[0].v_type = VAR_NUMBER;
      argv[0].vval.v_number = active ? 1 : 0;
      argv[1].v_type = VAR_UNKNOWN;
!     (void)call_func_retnr(p_imaf, 1, argv, FALSE);
  }
  
      static int
--- 4825,4831 ----
      argv[0].v_type = VAR_NUMBER;
      argv[0].vval.v_number = active ? 1 : 0;
      argv[1].v_type = VAR_UNKNOWN;
!     (void)call_func_retnr(p_imaf, 1, argv);
  }
  
      static int
***************
*** 4839,4845 ****
      /* FIXME: :py print 'xxx' is shown duplicate result.
       * Use silent to avoid it. */
      ++msg_silent;
!     is_active = call_func_retnr(p_imsf, 0, NULL, FALSE);
      --msg_silent;
      return (is_active > 0);
  }
--- 4839,4845 ----
      /* FIXME: :py print 'xxx' is shown duplicate result.
       * Use silent to avoid it. */
      ++msg_silent;
!     is_active = call_func_retnr(p_imsf, 0, NULL);
      --msg_silent;
      return (is_active > 0);
  }
*** ../vim-8.1.0232/src/normal.c	2018-07-29 16:09:14.640945583 +0200
--- src/normal.c	2018-08-01 18:59:09.360371320 +0200
***************
*** 2248,2254 ****
  	virtual_op = MAYBE;
  # endif
  
! 	(void)call_func_retnr(p_opfunc, 1, argv, FALSE);
  
  # ifdef FEAT_VIRTUALEDIT
  	virtual_op = save_virtual_op;
--- 2248,2254 ----
  	virtual_op = MAYBE;
  # endif
  
! 	(void)call_func_retnr(p_opfunc, 1, argv);
  
  # ifdef FEAT_VIRTUALEDIT
  	virtual_op = save_virtual_op;
*** ../vim-8.1.0232/src/ex_getln.c	2018-07-28 19:20:09.787586245 +0200
--- src/ex_getln.c	2018-08-01 19:00:06.272086002 +0200
***************
*** 5279,5285 ****
   */
      static void *
  call_user_expand_func(
!     void	*(*user_expand_func)(char_u *, int, typval_T *, int),
      expand_T	*xp,
      int		*num_file,
      char_u	***file)
--- 5279,5285 ----
   */
      static void *
  call_user_expand_func(
!     void	*(*user_expand_func)(char_u *, int, typval_T *),
      expand_T	*xp,
      int		*num_file,
      char_u	***file)
***************
*** 5318,5324 ****
      ccline.cmdprompt = NULL;
      current_SID = xp->xp_scriptID;
  
!     ret = user_expand_func(xp->xp_arg, 3, args, FALSE);
  
      ccline = save_ccline;
      current_SID = save_current_SID;
--- 5318,5324 ----
      ccline.cmdprompt = NULL;
      current_SID = xp->xp_scriptID;
  
!     ret = user_expand_func(xp->xp_arg, 3, args);
  
      ccline = save_ccline;
      current_SID = save_current_SID;
*** ../vim-8.1.0232/src/version.c	2018-08-01 18:42:09.837344296 +0200
--- src/version.c	2018-08-01 19:05:21.534428381 +0200
***************
*** 796,797 ****
--- 796,799 ----
  {   /* Add new patch number below this line */
+ /**/
+     233,
  /**/

-- 
Some say the world will end in fire; some say in segfaults.
I say it will end in a curly bracket.

 /// 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    ///