summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0753
blob: fb1095e5f30b1f39a03399461168e3ec3d1c7540 (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
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
543
544
545
546
547
548
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0753
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.0753
Problem:    printf format not checked for semsg().
Solution:   Add GNUC attribute and fix reported problems. (Dominique Pelle,
            closes #3805)
Files:	    src/buffer.c, src/diff.c, src/eval.c, src/evalfunc.c,
            src/ex_docmd.c, src/if_cscope.c, src/netbeans.c, src/proto.h,
            src/proto/message.pro, src/quickfix.c, src/regexp_nfa.c,
            src/sign.c, src/spellfile.c, src/window.c, src/gui_x11.c


*** ../vim-8.1.0752/src/buffer.c	2019-01-13 23:38:33.375773418 +0100
--- src/buffer.c	2019-01-15 20:12:27.203089550 +0100
***************
*** 1407,1413 ****
  	    else
  #endif
  	    {
! 		semsg(_("E89: No write since last change for buffer %ld (add ! to override)"),
  								 buf->b_fnum);
  		return FAIL;
  	    }
--- 1407,1413 ----
  	    else
  #endif
  	    {
! 		semsg(_("E89: No write since last change for buffer %d (add ! to override)"),
  								 buf->b_fnum);
  		return FAIL;
  	    }
***************
*** 2283,2289 ****
  	if ((options & GETF_ALT) && n == 0)
  	    emsg(_(e_noalt));
  	else
! 	    semsg(_("E92: Buffer %ld not found"), n);
  	return FAIL;
      }
  
--- 2283,2289 ----
  	if ((options & GETF_ALT) && n == 0)
  	    emsg(_(e_noalt));
  	else
! 	    semsg(_("E92: Buffer %d not found"), n);
  	return FAIL;
      }
  
*** ../vim-8.1.0752/src/diff.c	2019-01-13 23:38:33.379773390 +0100
--- src/diff.c	2019-01-15 20:12:27.203089550 +0100
***************
*** 173,179 ****
  	    return;
  	}
  
!     semsg(_("E96: Cannot diff more than %ld buffers"), DB_COUNT);
  }
  
  /*
--- 173,179 ----
  	    return;
  	}
  
!     semsg(_("E96: Cannot diff more than %d buffers"), DB_COUNT);
  }
  
  /*
*** ../vim-8.1.0752/src/eval.c	2019-01-14 22:53:26.750381258 +0100
--- src/eval.c	2019-01-15 20:12:27.207089517 +0100
***************
*** 268,274 ****
  
  /*
   * Sort the function table by function name.
!  * The sorting of the table above is ASCII dependant.
   * On machines using EBCDIC we have to sort it.
   */
      static void
--- 268,274 ----
  
  /*
   * Sort the function table by function name.
!  * The sorting of the table above is ASCII dependent.
   * On machines using EBCDIC we have to sort it.
   */
      static void
*** ../vim-8.1.0752/src/evalfunc.c	2019-01-13 23:38:33.387773334 +0100
--- src/evalfunc.c	2019-01-15 20:12:27.207089517 +0100
***************
*** 8256,8262 ****
  	return;
      if (id >= 1 && id <= 3)
      {
! 	semsg(_("E798: ID is reserved for \":match\": %ld"), id);
  	return;
      }
  
--- 8256,8262 ----
  	return;
      if (id >= 1 && id <= 3)
      {
! 	semsg(_("E798: ID is reserved for \":match\": %d"), id);
  	return;
      }
  
***************
*** 8314,8320 ****
      /* id == 3 is ok because matchaddpos() is supposed to substitute :3match */
      if (id == 1 || id == 2)
      {
! 	semsg(_("E798: ID is reserved for \":match\": %ld"), id);
  	return;
      }
  
--- 8314,8320 ----
      /* id == 3 is ok because matchaddpos() is supposed to substitute :3match */
      if (id == 1 || id == 2)
      {
! 	semsg(_("E798: ID is reserved for \":match\": %d"), id);
  	return;
      }
  
*** ../vim-8.1.0752/src/ex_docmd.c	2019-01-15 20:07:44.693265335 +0100
--- src/ex_docmd.c	2019-01-15 20:12:31.131059874 +0100
***************
*** 1347,1353 ****
  	    }
  	    else if (p != NULL)
  	    {
! 		semsg(p);
  		vim_free(p);
  	    }
  	    vim_free(sourcing_name);
--- 1347,1353 ----
  	    }
  	    else if (p != NULL)
  	    {
! 		emsg(p);
  		vim_free(p);
  	    }
  	    vim_free(sourcing_name);
***************
*** 5788,5795 ****
  		return FAIL;
  	    }
  #endif
! 	    semsg(NGETTEXT("E173: %ld more file to edit",
! 			"E173: %ld more files to edit", n), n);
  	    quitmore = 2;	    /* next try to quit is allowed */
  	}
  	return FAIL;
--- 5788,5795 ----
  		return FAIL;
  	    }
  #endif
! 	    semsg(NGETTEXT("E173: %d more file to edit",
! 			"E173: %d more files to edit", n), n);
  	    quitmore = 2;	    /* next try to quit is allowed */
  	}
  	return FAIL;
***************
*** 6958,6964 ****
  		}
  	    }
  
! 	    /* break if there no <item> is found */
  	    if (start == NULL || end == NULL)
  		break;
  
--- 6958,6964 ----
  		}
  	    }
  
! 	    /* break if no <item> is found */
  	    if (start == NULL || end == NULL)
  		break;
  
***************
*** 8022,8028 ****
  /*
   * Handle a file drop. The code is here because a drop is *nearly* like an
   * :args command, but not quite (we have a list of exact filenames, so we
!  * don't want to (a) parse a command line, or (b) expand wildcards. So the
   * code is very similar to :args and hence needs access to a lot of the static
   * functions in this file.
   *
--- 8022,8028 ----
  /*
   * Handle a file drop. The code is here because a drop is *nearly* like an
   * :args command, but not quite (we have a list of exact filenames, so we
!  * don't want to (a) parse a command line, or (b) expand wildcards). So the
   * code is very similar to :args and hence needs access to a lot of the static
   * functions in this file.
   *
*** ../vim-8.1.0752/src/if_cscope.c	2019-01-13 23:38:33.395773275 +0100
--- src/if_cscope.c	2019-01-15 20:12:31.131059874 +0100
***************
*** 651,657 ****
  cs_reading_emsg(
      int idx)	/* connection index */
  {
!     semsg(_("E262: error reading cscope connection %ld"), idx);
  }
  
  #define	CSREAD_BUFSIZE	2048
--- 651,657 ----
  cs_reading_emsg(
      int idx)	/* connection index */
  {
!     semsg(_("E262: error reading cscope connection %d"), idx);
  }
  
  #define	CSREAD_BUFSIZE	2048
*** ../vim-8.1.0752/src/netbeans.c	2019-01-13 23:38:33.403773217 +0100
--- src/netbeans.c	2019-01-15 20:12:31.135059844 +0100
***************
*** 1541,1547 ****
  		if (!buf->bufp->b_netbeans_file)
  		{
  		    nbdebug(("E658: NetBeans connection lost for buffer %ld\n", buf->bufp->b_fnum));
! 		    semsg(_("E658: NetBeans connection lost for buffer %ld"),
  							   buf->bufp->b_fnum);
  		}
  		else
--- 1541,1547 ----
  		if (!buf->bufp->b_netbeans_file)
  		{
  		    nbdebug(("E658: NetBeans connection lost for buffer %ld\n", buf->bufp->b_fnum));
! 		    semsg(_("E658: NetBeans connection lost for buffer %d"),
  							   buf->bufp->b_fnum);
  		}
  		else
*** ../vim-8.1.0752/src/proto.h	2019-01-13 23:38:33.407773189 +0100
--- src/proto.h	2019-01-15 20:12:31.135059844 +0100
***************
*** 108,126 ****
  #  ifdef __BORLANDC__
  _RTLENTRYF
  #  endif
! smsg(const char *, ...);
  
  int
  #  ifdef __BORLANDC__
  _RTLENTRYF
  #  endif
! smsg_attr(int, const char *, ...);
  
  int
  #  ifdef __BORLANDC__
  _RTLENTRYF
  #  endif
! smsg_attr_keep(int, const char *, ...);
  
  int
  #  ifdef __BORLANDC__
--- 108,138 ----
  #  ifdef __BORLANDC__
  _RTLENTRYF
  #  endif
! smsg(const char *, ...)
! #ifdef USE_PRINTF_FORMAT_ATTRIBUTE
!     __attribute__((format(printf, 1, 0)))
! #endif
!     ;
  
  int
  #  ifdef __BORLANDC__
  _RTLENTRYF
  #  endif
! smsg_attr(int, const char *, ...)
! #ifdef USE_PRINTF_FORMAT_ATTRIBUTE
!     __attribute__((format(printf, 2, 3)))
! #endif
!     ;
  
  int
  #  ifdef __BORLANDC__
  _RTLENTRYF
  #  endif
! smsg_attr_keep(int, const char *, ...)
! #ifdef USE_PRINTF_FORMAT_ATTRIBUTE
!     __attribute__((format(printf, 2, 3)))
! #endif
!     ;
  
  int
  #  ifdef __BORLANDC__
*** ../vim-8.1.0752/src/proto/message.pro	2019-01-13 23:38:33.407773189 +0100
--- src/proto/message.pro	2019-01-15 20:12:35.675025564 +0100
***************
*** 11,19 ****
  void ignore_error_for_testing(char_u *error);
  void do_perror(char *msg);
  int emsg(char *s);
! int semsg(const char *s, ...);
  void iemsg(char *s);
! void siemsg(const char *s, ...);
  void internal_error(char *where);
  void emsg_invreg(int name);
  char_u *msg_trunc_attr(char_u *s, int force, int attr);
--- 11,28 ----
  void ignore_error_for_testing(char_u *error);
  void do_perror(char *msg);
  int emsg(char *s);
! 
! int semsg(const char *s, ...)
! #ifdef USE_PRINTF_FORMAT_ATTRIBUTE
!     __attribute__((format(printf, 1, 2)))
! #endif
! ;
  void iemsg(char *s);
! void siemsg(const char *s, ...)
! #ifdef USE_PRINTF_FORMAT_ATTRIBUTE
!     __attribute__((format(printf, 1, 2)))
! #endif
! ;
  void internal_error(char *where);
  void emsg_invreg(int name);
  char_u *msg_trunc_attr(char_u *s, int force, int attr);
*** ../vim-8.1.0752/src/quickfix.c	2019-01-13 23:38:33.407773189 +0100
--- src/quickfix.c	2019-01-15 20:12:35.675025564 +0100
***************
*** 6263,6269 ****
  	if (!did_bufnr_emsg)
  	{
  	    did_bufnr_emsg = TRUE;
! 	    semsg(_("E92: Buffer %ld not found"), bufnum);
  	}
  	valid = FALSE;
  	bufnum = 0;
--- 6263,6269 ----
  	if (!did_bufnr_emsg)
  	{
  	    did_bufnr_emsg = TRUE;
! 	    semsg(_("E92: Buffer %d not found"), bufnum);
  	}
  	valid = FALSE;
  	bufnum = 0;
*** ../vim-8.1.0752/src/regexp_nfa.c	2019-01-13 23:38:33.407773189 +0100
--- src/regexp_nfa.c	2019-01-15 20:12:35.675025564 +0100
***************
*** 1307,1313 ****
  		    rc_did_emsg = TRUE;
  		    return FAIL;
  		}
! 		siemsg("INTERNAL: Unknown character class char: %ld", c);
  		return FAIL;
  	    }
  #ifdef FEAT_MBYTE
--- 1307,1313 ----
  		    rc_did_emsg = TRUE;
  		    return FAIL;
  		}
! 		siemsg("INTERNAL: Unknown character class char: %d", c);
  		return FAIL;
  	    }
  #ifdef FEAT_MBYTE
*** ../vim-8.1.0752/src/sign.c	2019-01-14 23:08:13.058543291 +0100
--- src/sign.c	2019-01-15 20:12:35.675025564 +0100
***************
*** 162,168 ****
  	group = HI2SG(hi);
      }
  
!     // Search for the next usuable sign identifier
      while (!found)
      {
  	if (group == NULL)
--- 162,168 ----
  	group = HI2SG(hi);
      }
  
!     // Search for the next usable sign identifier
      while (!found)
      {
  	if (group == NULL)
***************
*** 996,1002 ****
  
      if ((lnum = buf_findsign(buf, sign_id, sign_group)) <= 0)
      {
! 	semsg(_("E157: Invalid sign ID: %ld"), sign_id);
  	return -1;
      }
  
--- 996,1002 ----
  
      if ((lnum = buf_findsign(buf, sign_id, sign_group)) <= 0)
      {
! 	semsg(_("E157: Invalid sign ID: %d"), sign_id);
  	return -1;
      }
  
*** ../vim-8.1.0752/src/spellfile.c	2019-01-13 23:38:33.411773162 +0100
--- src/spellfile.c	2019-01-15 20:12:35.675025564 +0100
***************
*** 6014,6020 ****
      else if (vim_strchr(gettail(wfname), '_') != NULL)
  	emsg(_("E751: Output file name must not have region name"));
      else if (incount > MAXREGIONS)
! 	semsg(_("E754: Only up to %ld regions supported"), MAXREGIONS);
      else
      {
  	/* Check for overwriting before doing things that may take a lot of
--- 6014,6020 ----
      else if (vim_strchr(gettail(wfname), '_') != NULL)
  	emsg(_("E751: Output file name must not have region name"));
      else if (incount > MAXREGIONS)
! 	semsg(_("E754: Only up to %d regions supported"), MAXREGIONS);
      else
      {
  	/* Check for overwriting before doing things that may take a lot of
***************
*** 6274,6280 ****
  		break;
  	    if (*spf == NUL)
  	    {
! 		semsg(_("E765: 'spellfile' does not have %ld entries"), idx);
  		vim_free(fnamebuf);
  		return;
  	    }
--- 6274,6280 ----
  		break;
  	    if (*spf == NUL)
  	    {
! 		semsg(_("E765: 'spellfile' does not have %d entries"), idx);
  		vim_free(fnamebuf);
  		return;
  	    }
*** ../vim-8.1.0752/src/window.c	2019-01-13 23:38:33.415773131 +0100
--- src/window.c	2019-01-15 20:12:35.679025534 +0100
***************
*** 6782,6788 ****
  	return -1;
      if (id < -1 || id == 0)
      {
! 	semsg(_("E799: Invalid ID: %ld (must be greater than or equal to 1)"), id);
  	return -1;
      }
      if (id != -1)
--- 6782,6788 ----
  	return -1;
      if (id < -1 || id == 0)
      {
! 	semsg(_("E799: Invalid ID: %d (must be greater than or equal to 1)"), id);
  	return -1;
      }
      if (id != -1)
***************
*** 6792,6798 ****
  	{
  	    if (cur->id == id)
  	    {
! 		semsg(_("E801: ID already taken: %ld"), id);
  		return -1;
  	    }
  	    cur = cur->next;
--- 6792,6798 ----
  	{
  	    if (cur->id == id)
  	    {
! 		semsg(_("E801: ID already taken: %d"), id);
  		return -1;
  	    }
  	    cur = cur->next;
***************
*** 6969,6975 ****
      if (id < 1)
      {
  	if (perr == TRUE)
! 	    semsg(_("E802: Invalid ID: %ld (must be greater than or equal to 1)"),
  									  id);
  	return -1;
      }
--- 6969,6975 ----
      if (id < 1)
      {
  	if (perr == TRUE)
! 	    semsg(_("E802: Invalid ID: %d (must be greater than or equal to 1)"),
  									  id);
  	return -1;
      }
***************
*** 6981,6987 ****
      if (cur == NULL)
      {
  	if (perr == TRUE)
! 	    semsg(_("E803: ID not found: %ld"), id);
  	return -1;
      }
      if (cur == prev)
--- 6981,6987 ----
      if (cur == NULL)
      {
  	if (perr == TRUE)
! 	    semsg(_("E803: ID not found: %d"), id);
  	return -1;
      }
      if (cur == prev)
*** ../vim-8.1.0752/src/gui_x11.c	2019-01-13 23:38:33.395773275 +0100
--- src/gui_x11.c	2019-01-15 20:16:45.801159811 +0100
***************
*** 2210,2218 ****
  	    semsg(_("E253: Fontset name: %s"), base_name);
  	    semsg(_("Font0: %s"), font_name[min_font_idx]);
  	    semsg(_("Font1: %s"), font_name[i]);
! 	    semsg(_("Font%ld width is not twice that of font0"), i);
! 	    semsg(_("Font0 width: %ld"), xfs[min_font_idx]->max_bounds.width);
! 	    semsg(_("Font1 width: %ld"), xfs[i]->max_bounds.width);
  	    return FAIL;
  	}
      }
--- 2210,2219 ----
  	    semsg(_("E253: Fontset name: %s"), base_name);
  	    semsg(_("Font0: %s"), font_name[min_font_idx]);
  	    semsg(_("Font1: %s"), font_name[i]);
! 	    semsg(_("Font%d width is not twice that of font0"), i);
! 	    semsg(_("Font0 width: %d"),
! 				     (int)xfs[min_font_idx]->max_bounds.width);
! 	    semsg(_("Font%d width: %d"), i, (int)xfs[i]->max_bounds.width);
  	    return FAIL;
  	}
      }
*** ../vim-8.1.0752/src/version.c	2019-01-15 20:07:44.697265303 +0100
--- src/version.c	2019-01-15 20:11:25.723555755 +0100
***************
*** 797,798 ****
--- 797,800 ----
  {   /* Add new patch number below this line */
+ /**/
+     753,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
212. Your Internet group window has more icons than your Accessories window.

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