summaryrefslogtreecommitdiffstats
path: root/source/ap/vim/patches/7.3.056
blob: 49c91b62589a4df8786ac767a99070e699d81039 (about) (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
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
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
To: vim_dev@googlegroups.com
Subject: Patch 7.3.056
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.3.056
Problem:    "getline" argument in do_cmdline() shadows global.
Solution:   Rename the argument.
Files:	    src/ex_docmd.c


*** ../vim-7.3.055/src/ex_docmd.c	2010-11-10 18:59:50.000000000 +0100
--- src/ex_docmd.c	2010-11-16 11:24:40.000000000 +0100
***************
*** 733,739 ****
   * do_cmdline(): execute one Ex command line
   *
   * 1. Execute "cmdline" when it is not NULL.
!  *    If "cmdline" is NULL, or more lines are needed, getline() is used.
   * 2. Split up in parts separated with '|'.
   *
   * This function can be called recursively!
--- 733,739 ----
   * do_cmdline(): execute one Ex command line
   *
   * 1. Execute "cmdline" when it is not NULL.
!  *    If "cmdline" is NULL, or more lines are needed, fgetline() is used.
   * 2. Split up in parts separated with '|'.
   *
   * This function can be called recursively!
***************
*** 741,747 ****
   * flags:
   * DOCMD_VERBOSE  - The command will be included in the error message.
   * DOCMD_NOWAIT   - Don't call wait_return() and friends.
!  * DOCMD_REPEAT   - Repeat execution until getline() returns NULL.
   * DOCMD_KEYTYPED - Don't reset KeyTyped.
   * DOCMD_EXCRESET - Reset the exception environment (used for debugging).
   * DOCMD_KEEPLINE - Store first typed line (for repeating with ".").
--- 741,747 ----
   * flags:
   * DOCMD_VERBOSE  - The command will be included in the error message.
   * DOCMD_NOWAIT   - Don't call wait_return() and friends.
!  * DOCMD_REPEAT   - Repeat execution until fgetline() returns NULL.
   * DOCMD_KEYTYPED - Don't reset KeyTyped.
   * DOCMD_EXCRESET - Reset the exception environment (used for debugging).
   * DOCMD_KEEPLINE - Store first typed line (for repeating with ".").
***************
*** 749,763 ****
   * return FAIL if cmdline could not be executed, OK otherwise
   */
      int
! do_cmdline(cmdline, getline, cookie, flags)
      char_u	*cmdline;
!     char_u	*(*getline) __ARGS((int, void *, int));
!     void	*cookie;		/* argument for getline() */
      int		flags;
  {
      char_u	*next_cmdline;		/* next cmd to execute */
      char_u	*cmdline_copy = NULL;	/* copy of cmd line */
!     int		used_getline = FALSE;	/* used "getline" to obtain command */
      static int	recursive = 0;		/* recursive depth */
      int		msg_didout_before_start = 0;
      int		count = 0;		/* line number count */
--- 749,763 ----
   * return FAIL if cmdline could not be executed, OK otherwise
   */
      int
! do_cmdline(cmdline, fgetline, cookie, flags)
      char_u	*cmdline;
!     char_u	*(*fgetline) __ARGS((int, void *, int));
!     void	*cookie;		/* argument for fgetline() */
      int		flags;
  {
      char_u	*next_cmdline;		/* next cmd to execute */
      char_u	*cmdline_copy = NULL;	/* copy of cmd line */
!     int		used_getline = FALSE;	/* used "fgetline" to obtain command */
      static int	recursive = 0;		/* recursive depth */
      int		msg_didout_before_start = 0;
      int		count = 0;		/* line number count */
***************
*** 775,788 ****
      struct msglist	**saved_msg_list = NULL;
      struct msglist	*private_msg_list;
  
!     /* "getline" and "cookie" passed to do_one_cmd() */
      char_u	*(*cmd_getline) __ARGS((int, void *, int));
      void	*cmd_cookie;
      struct loop_cookie cmd_loop_cookie;
      void	*real_cookie;
      int		getline_is_func;
  #else
! # define cmd_getline getline
  # define cmd_cookie cookie
  #endif
      static int	call_depth = 0;		/* recursiveness */
--- 775,788 ----
      struct msglist	**saved_msg_list = NULL;
      struct msglist	*private_msg_list;
  
!     /* "fgetline" and "cookie" passed to do_one_cmd() */
      char_u	*(*cmd_getline) __ARGS((int, void *, int));
      void	*cmd_cookie;
      struct loop_cookie cmd_loop_cookie;
      void	*real_cookie;
      int		getline_is_func;
  #else
! # define cmd_getline fgetline
  # define cmd_cookie cookie
  #endif
      static int	call_depth = 0;		/* recursiveness */
***************
*** 822,831 ****
      cstack.cs_lflags = 0;
      ga_init2(&lines_ga, (int)sizeof(wcmd_T), 10);
  
!     real_cookie = getline_cookie(getline, cookie);
  
      /* Inside a function use a higher nesting level. */
!     getline_is_func = getline_equal(getline, cookie, get_func_line);
      if (getline_is_func && ex_nesting_level == func_level(real_cookie))
  	++ex_nesting_level;
  
--- 822,831 ----
      cstack.cs_lflags = 0;
      ga_init2(&lines_ga, (int)sizeof(wcmd_T), 10);
  
!     real_cookie = getline_cookie(fgetline, cookie);
  
      /* Inside a function use a higher nesting level. */
!     getline_is_func = getline_equal(fgetline, cookie, get_func_line);
      if (getline_is_func && ex_nesting_level == func_level(real_cookie))
  	++ex_nesting_level;
  
***************
*** 837,843 ****
  	breakpoint = func_breakpoint(real_cookie);
  	dbg_tick = func_dbg_tick(real_cookie);
      }
!     else if (getline_equal(getline, cookie, getsourceline))
      {
  	fname = sourcing_name;
  	breakpoint = source_breakpoint(real_cookie);
--- 837,843 ----
  	breakpoint = func_breakpoint(real_cookie);
  	dbg_tick = func_dbg_tick(real_cookie);
      }
!     else if (getline_equal(fgetline, cookie, getsourceline))
      {
  	fname = sourcing_name;
  	breakpoint = source_breakpoint(real_cookie);
***************
*** 881,887 ****
       * KeyTyped is only set when calling vgetc().  Reset it here when not
       * calling vgetc() (sourced command lines).
       */
!     if (!(flags & DOCMD_KEYTYPED) && !getline_equal(getline, cookie, getexline))
  	KeyTyped = FALSE;
  
      /*
--- 881,888 ----
       * KeyTyped is only set when calling vgetc().  Reset it here when not
       * calling vgetc() (sourced command lines).
       */
!     if (!(flags & DOCMD_KEYTYPED)
! 			       && !getline_equal(fgetline, cookie, getexline))
  	KeyTyped = FALSE;
  
      /*
***************
*** 894,900 ****
      do
      {
  #ifdef FEAT_EVAL
! 	getline_is_func = getline_equal(getline, cookie, get_func_line);
  #endif
  
  	/* stop skipping cmds for an error msg after all endif/while/for */
--- 895,901 ----
      do
      {
  #ifdef FEAT_EVAL
! 	getline_is_func = getline_equal(fgetline, cookie, get_func_line);
  #endif
  
  	/* stop skipping cmds for an error msg after all endif/while/for */
***************
*** 909,915 ****
  
  	/*
  	 * 1. If repeating a line in a loop, get a line from lines_ga.
! 	 * 2. If no line given: Get an allocated line with getline().
  	 * 3. If a line is given: Make a copy, so we can mess with it.
  	 */
  
--- 910,916 ----
  
  	/*
  	 * 1. If repeating a line in a loop, get a line from lines_ga.
! 	 * 2. If no line given: Get an allocated line with fgetline().
  	 * 3. If a line is given: Make a copy, so we can mess with it.
  	 */
  
***************
*** 938,949 ****
  	    }
  #ifdef FEAT_PROFILE
  	    else if (do_profiling == PROF_YES
! 			     && getline_equal(getline, cookie, getsourceline))
  		script_line_end();
  #endif
  
  	    /* Check if a sourced file hit a ":finish" command. */
! 	    if (source_finished(getline, cookie))
  	    {
  		retval = FAIL;
  		break;
--- 939,950 ----
  	    }
  #ifdef FEAT_PROFILE
  	    else if (do_profiling == PROF_YES
! 			    && getline_equal(fgetline, cookie, getsourceline))
  		script_line_end();
  #endif
  
  	    /* Check if a sourced file hit a ":finish" command. */
! 	    if (source_finished(fgetline, cookie))
  	    {
  		retval = FAIL;
  		break;
***************
*** 954,960 ****
  						   && *dbg_tick != debug_tick)
  	    {
  		*breakpoint = dbg_find_breakpoint(
! 				getline_equal(getline, cookie, getsourceline),
  							fname, sourcing_lnum);
  		*dbg_tick = debug_tick;
  	    }
--- 955,961 ----
  						   && *dbg_tick != debug_tick)
  	    {
  		*breakpoint = dbg_find_breakpoint(
! 				getline_equal(fgetline, cookie, getsourceline),
  							fname, sourcing_lnum);
  		*dbg_tick = debug_tick;
  	    }
***************
*** 969,975 ****
  		dbg_breakpoint(fname, sourcing_lnum);
  		/* Find next breakpoint. */
  		*breakpoint = dbg_find_breakpoint(
! 				getline_equal(getline, cookie, getsourceline),
  							fname, sourcing_lnum);
  		*dbg_tick = debug_tick;
  	    }
--- 970,976 ----
  		dbg_breakpoint(fname, sourcing_lnum);
  		/* Find next breakpoint. */
  		*breakpoint = dbg_find_breakpoint(
! 			       getline_equal(fgetline, cookie, getsourceline),
  							fname, sourcing_lnum);
  		*dbg_tick = debug_tick;
  	    }
***************
*** 978,984 ****
  	    {
  		if (getline_is_func)
  		    func_line_start(real_cookie);
! 		else if (getline_equal(getline, cookie, getsourceline))
  		    script_line_start();
  	    }
  # endif
--- 979,985 ----
  	    {
  		if (getline_is_func)
  		    func_line_start(real_cookie);
! 		else if (getline_equal(fgetline, cookie, getsourceline))
  		    script_line_start();
  	    }
  # endif
***************
*** 987,993 ****
  	if (cstack.cs_looplevel > 0)
  	{
  	    /* Inside a while/for loop we need to store the lines and use them
! 	     * again.  Pass a different "getline" function to do_one_cmd()
  	     * below, so that it stores lines in or reads them from
  	     * "lines_ga".  Makes it possible to define a function inside a
  	     * while/for loop. */
--- 988,994 ----
  	if (cstack.cs_looplevel > 0)
  	{
  	    /* Inside a while/for loop we need to store the lines and use them
! 	     * again.  Pass a different "fgetline" function to do_one_cmd()
  	     * below, so that it stores lines in or reads them from
  	     * "lines_ga".  Makes it possible to define a function inside a
  	     * while/for loop. */
***************
*** 995,1021 ****
  	    cmd_cookie = (void *)&cmd_loop_cookie;
  	    cmd_loop_cookie.lines_gap = &lines_ga;
  	    cmd_loop_cookie.current_line = current_line;
! 	    cmd_loop_cookie.getline = getline;
  	    cmd_loop_cookie.cookie = cookie;
  	    cmd_loop_cookie.repeating = (current_line < lines_ga.ga_len);
  	}
  	else
  	{
! 	    cmd_getline = getline;
  	    cmd_cookie = cookie;
  	}
  #endif
  
! 	/* 2. If no line given, get an allocated line with getline(). */
  	if (next_cmdline == NULL)
  	{
  	    /*
  	     * Need to set msg_didout for the first line after an ":if",
  	     * otherwise the ":if" will be overwritten.
  	     */
! 	    if (count == 1 && getline_equal(getline, cookie, getexline))
  		msg_didout = TRUE;
! 	    if (getline == NULL || (next_cmdline = getline(':', cookie,
  #ifdef FEAT_EVAL
  		    cstack.cs_idx < 0 ? 0 : (cstack.cs_idx + 1) * 2
  #else
--- 996,1022 ----
  	    cmd_cookie = (void *)&cmd_loop_cookie;
  	    cmd_loop_cookie.lines_gap = &lines_ga;
  	    cmd_loop_cookie.current_line = current_line;
! 	    cmd_loop_cookie.getline = fgetline;
  	    cmd_loop_cookie.cookie = cookie;
  	    cmd_loop_cookie.repeating = (current_line < lines_ga.ga_len);
  	}
  	else
  	{
! 	    cmd_getline = fgetline;
  	    cmd_cookie = cookie;
  	}
  #endif
  
! 	/* 2. If no line given, get an allocated line with fgetline(). */
  	if (next_cmdline == NULL)
  	{
  	    /*
  	     * Need to set msg_didout for the first line after an ":if",
  	     * otherwise the ":if" will be overwritten.
  	     */
! 	    if (count == 1 && getline_equal(fgetline, cookie, getexline))
  		msg_didout = TRUE;
! 	    if (fgetline == NULL || (next_cmdline = fgetline(':', cookie,
  #ifdef FEAT_EVAL
  		    cstack.cs_idx < 0 ? 0 : (cstack.cs_idx + 1) * 2
  #else
***************
*** 1142,1148 ****
  	     * If the command was typed, remember it for the ':' register.
  	     * Do this AFTER executing the command to make :@: work.
  	     */
! 	    if (getline_equal(getline, cookie, getexline)
  						  && new_last_cmdline != NULL)
  	    {
  		vim_free(last_cmdline);
--- 1143,1149 ----
  	     * If the command was typed, remember it for the ':' register.
  	     * Do this AFTER executing the command to make :@: work.
  	     */
! 	    if (getline_equal(fgetline, cookie, getexline)
  						  && new_last_cmdline != NULL)
  	    {
  		vim_free(last_cmdline);
***************
*** 1163,1169 ****
  #ifdef FEAT_EVAL
  	/* reset did_emsg for a function that is not aborted by an error */
  	if (did_emsg && !force_abort
! 		&& getline_equal(getline, cookie, get_func_line)
  					      && !func_has_abort(real_cookie))
  	    did_emsg = FALSE;
  
--- 1164,1170 ----
  #ifdef FEAT_EVAL
  	/* reset did_emsg for a function that is not aborted by an error */
  	if (did_emsg && !force_abort
! 		&& getline_equal(fgetline, cookie, get_func_line)
  					      && !func_has_abort(real_cookie))
  	    did_emsg = FALSE;
  
***************
*** 1202,1208 ****
  		    if (breakpoint != NULL)
  		    {
  			*breakpoint = dbg_find_breakpoint(
! 				getline_equal(getline, cookie, getsourceline),
  									fname,
  			   ((wcmd_T *)lines_ga.ga_data)[current_line].lnum-1);
  			*dbg_tick = debug_tick;
--- 1203,1209 ----
  		    if (breakpoint != NULL)
  		    {
  			*breakpoint = dbg_find_breakpoint(
! 			       getline_equal(fgetline, cookie, getsourceline),
  									fname,
  			   ((wcmd_T *)lines_ga.ga_data)[current_line].lnum-1);
  			*dbg_tick = debug_tick;
***************
*** 1296,1303 ****
  #endif
  	    )
  	    && !(did_emsg && used_getline
! 			  && (getline_equal(getline, cookie, getexmodeline)
! 				|| getline_equal(getline, cookie, getexline)))
  	    && (next_cmdline != NULL
  #ifdef FEAT_EVAL
  			|| cstack.cs_idx >= 0
--- 1297,1304 ----
  #endif
  	    )
  	    && !(did_emsg && used_getline
! 			    && (getline_equal(fgetline, cookie, getexmodeline)
! 			       || getline_equal(fgetline, cookie, getexline)))
  	    && (next_cmdline != NULL
  #ifdef FEAT_EVAL
  			|| cstack.cs_idx >= 0
***************
*** 1316,1324 ****
  	 * unclosed conditional.
  	 */
  	if (!got_int && !did_throw
! 		&& ((getline_equal(getline, cookie, getsourceline)
! 			&& !source_finished(getline, cookie))
! 		    || (getline_equal(getline, cookie, get_func_line)
  					    && !func_has_ended(real_cookie))))
  	{
  	    if (cstack.cs_flags[cstack.cs_idx] & CSF_TRY)
--- 1317,1325 ----
  	 * unclosed conditional.
  	 */
  	if (!got_int && !did_throw
! 		&& ((getline_equal(fgetline, cookie, getsourceline)
! 			&& !source_finished(fgetline, cookie))
! 		    || (getline_equal(fgetline, cookie, get_func_line)
  					    && !func_has_ended(real_cookie))))
  	{
  	    if (cstack.cs_flags[cstack.cs_idx] & CSF_TRY)
***************
*** 1354,1360 ****
      /* If a missing ":endtry", ":endwhile", ":endfor", or ":endif" or a memory
       * lack was reported above and the error message is to be converted to an
       * exception, do this now after rewinding the cstack. */
!     do_errthrow(&cstack, getline_equal(getline, cookie, get_func_line)
  				  ? (char_u *)"endfunction" : (char_u *)NULL);
  
      if (trylevel == 0)
--- 1355,1361 ----
      /* If a missing ":endtry", ":endwhile", ":endfor", or ":endif" or a memory
       * lack was reported above and the error message is to be converted to an
       * exception, do this now after rewinding the cstack. */
!     do_errthrow(&cstack, getline_equal(fgetline, cookie, get_func_line)
  				  ? (char_u *)"endfunction" : (char_u *)NULL);
  
      if (trylevel == 0)
***************
*** 1449,1457 ****
       */
      if (did_throw)
  	need_rethrow = TRUE;
!     if ((getline_equal(getline, cookie, getsourceline)
  		&& ex_nesting_level > source_level(real_cookie))
! 	    || (getline_equal(getline, cookie, get_func_line)
  		&& ex_nesting_level > func_level(real_cookie) + 1))
      {
  	if (!did_throw)
--- 1450,1458 ----
       */
      if (did_throw)
  	need_rethrow = TRUE;
!     if ((getline_equal(fgetline, cookie, getsourceline)
  		&& ex_nesting_level > source_level(real_cookie))
! 	    || (getline_equal(fgetline, cookie, get_func_line)
  		&& ex_nesting_level > func_level(real_cookie) + 1))
      {
  	if (!did_throw)
***************
*** 1460,1475 ****
      else
      {
  	/* When leaving a function, reduce nesting level. */
! 	if (getline_equal(getline, cookie, get_func_line))
  	    --ex_nesting_level;
  	/*
  	 * Go to debug mode when returning from a function in which we are
  	 * single-stepping.
  	 */
! 	if ((getline_equal(getline, cookie, getsourceline)
! 		    || getline_equal(getline, cookie, get_func_line))
  		&& ex_nesting_level + 1 <= debug_break_level)
! 	    do_debug(getline_equal(getline, cookie, getsourceline)
  		    ? (char_u *)_("End of sourced file")
  		    : (char_u *)_("End of function"));
      }
--- 1461,1476 ----
      else
      {
  	/* When leaving a function, reduce nesting level. */
! 	if (getline_equal(fgetline, cookie, get_func_line))
  	    --ex_nesting_level;
  	/*
  	 * Go to debug mode when returning from a function in which we are
  	 * single-stepping.
  	 */
! 	if ((getline_equal(fgetline, cookie, getsourceline)
! 		    || getline_equal(fgetline, cookie, get_func_line))
  		&& ex_nesting_level + 1 <= debug_break_level)
! 	    do_debug(getline_equal(fgetline, cookie, getsourceline)
  		    ? (char_u *)_("End of sourced file")
  		    : (char_u *)_("End of function"));
      }
*** ../vim-7.3.055/src/version.c	2010-11-16 11:28:33.000000000 +0100
--- src/version.c	2010-11-16 11:27:09.000000000 +0100
***************
*** 716,717 ****
--- 716,719 ----
  {   /* Add new patch number below this line */
+ /**/
+     56,
  /**/

-- 
Lawmakers made it obligatory for everybody to take at least one bath
each week -- on Saturday night.
		[real standing law in Vermont, United States of America]

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