|
1 To: [email protected] |
|
2 Subject: Patch 7.2.333 |
|
3 Fcc: outbox |
|
4 From: Bram Moolenaar <[email protected]> |
|
5 Mime-Version: 1.0 |
|
6 Content-Type: text/plain; charset=UTF-8 |
|
7 Content-Transfer-Encoding: 8bit |
|
8 ------------ |
|
9 |
|
10 Patch 7.2.333 |
|
11 Problem: Warnings from static code analysis. |
|
12 Solution: Small changes to various lines. (Dominique Pelle) |
|
13 Files: src/buffer.c, src/edit.c, src/ex_getln.c, src/fileio.c, |
|
14 src/if_cscope.c, src/netbeans.c, src/ops.c, src/quickfix.c, |
|
15 src/syntax.c, src/ui.c |
|
16 |
|
17 |
|
18 *** ../vim-7.2.332/src/buffer.c 2009-05-17 13:30:58.000000000 +0200 |
|
19 --- src/buffer.c 2010-01-19 12:50:24.000000000 +0100 |
|
20 *************** |
|
21 *** 315,321 **** |
|
22 { |
|
23 #ifdef FEAT_AUTOCMD |
|
24 int is_curbuf; |
|
25 ! int nwindows = buf->b_nwindows; |
|
26 #endif |
|
27 int unload_buf = (action != 0); |
|
28 int del_buf = (action == DOBUF_DEL || action == DOBUF_WIPE); |
|
29 --- 315,321 ---- |
|
30 { |
|
31 #ifdef FEAT_AUTOCMD |
|
32 int is_curbuf; |
|
33 ! int nwindows; |
|
34 #endif |
|
35 int unload_buf = (action != 0); |
|
36 int del_buf = (action == DOBUF_DEL || action == DOBUF_WIPE); |
|
37 *** ../vim-7.2.332/src/edit.c 2009-12-24 15:45:53.000000000 +0100 |
|
38 --- src/edit.c 2010-01-19 12:53:18.000000000 +0100 |
|
39 *************** |
|
40 *** 4048,4054 **** |
|
41 save_p_ic = p_ic; |
|
42 p_ic = ignorecase(compl_pattern); |
|
43 |
|
44 ! /* Find up to TAG_MANY matches. Avoids that an enourmous number |
|
45 * of matches is found when compl_pattern is empty */ |
|
46 if (find_tags(compl_pattern, &num_matches, &matches, |
|
47 TAG_REGEXP | TAG_NAMES | TAG_NOIC | |
|
48 --- 4048,4054 ---- |
|
49 save_p_ic = p_ic; |
|
50 p_ic = ignorecase(compl_pattern); |
|
51 |
|
52 ! /* Find up to TAG_MANY matches. Avoids that an enormous number |
|
53 * of matches is found when compl_pattern is empty */ |
|
54 if (find_tags(compl_pattern, &num_matches, &matches, |
|
55 TAG_REGEXP | TAG_NAMES | TAG_NOIC | |
|
56 *************** |
|
57 *** 4219,4225 **** |
|
58 || IObuff[len - 2] == '!')))) |
|
59 IObuff[len++] = ' '; |
|
60 } |
|
61 ! /* copy as much as posible of the new word */ |
|
62 if (tmp_ptr - ptr >= IOSIZE - len) |
|
63 tmp_ptr = ptr + IOSIZE - len - 1; |
|
64 STRNCPY(IObuff + len, ptr, tmp_ptr - ptr); |
|
65 --- 4219,4225 ---- |
|
66 || IObuff[len - 2] == '!')))) |
|
67 IObuff[len++] = ' '; |
|
68 } |
|
69 ! /* copy as much as possible of the new word */ |
|
70 if (tmp_ptr - ptr >= IOSIZE - len) |
|
71 tmp_ptr = ptr + IOSIZE - len - 1; |
|
72 STRNCPY(IObuff + len, ptr, tmp_ptr - ptr); |
|
73 *************** |
|
74 *** 5827,5836 **** |
|
75 #endif |
|
76 && !has_format_option(FO_WRAP)) |
|
77 |
|
78 - { |
|
79 - textwidth = 0; |
|
80 break; |
|
81 - } |
|
82 if ((startcol = curwin->w_cursor.col) == 0) |
|
83 break; |
|
84 |
|
85 --- 5827,5833 ---- |
|
86 *** ../vim-7.2.332/src/ex_getln.c 2009-12-02 17:15:04.000000000 +0100 |
|
87 --- src/ex_getln.c 2010-01-19 12:54:47.000000000 +0100 |
|
88 *************** |
|
89 *** 2193,2199 **** |
|
90 { |
|
91 if (ga_grow(&line_ga, 40) == FAIL) |
|
92 break; |
|
93 - pend = (char_u *)line_ga.ga_data + line_ga.ga_len; |
|
94 |
|
95 /* Get one character at a time. Don't use inchar(), it can't handle |
|
96 * special characters. */ |
|
97 --- 2193,2198 ---- |
|
98 *************** |
|
99 *** 3314,3320 **** |
|
100 WILD_HOME_REPLACE|WILD_ADD_SLASH|WILD_SILENT|WILD_ESCAPE |
|
101 |options, type); |
|
102 vim_free(p1); |
|
103 ! /* longest match: make sure it is not shorter (happens with :help */ |
|
104 if (p2 != NULL && type == WILD_LONGEST) |
|
105 { |
|
106 for (j = 0; j < xp->xp_pattern_len; ++j) |
|
107 --- 3313,3319 ---- |
|
108 WILD_HOME_REPLACE|WILD_ADD_SLASH|WILD_SILENT|WILD_ESCAPE |
|
109 |options, type); |
|
110 vim_free(p1); |
|
111 ! /* longest match: make sure it is not shorter, happens with :help */ |
|
112 if (p2 != NULL && type == WILD_LONGEST) |
|
113 { |
|
114 for (j = 0; j < xp->xp_pattern_len; ++j) |
|
115 *** ../vim-7.2.332/src/fileio.c 2009-12-31 14:52:48.000000000 +0100 |
|
116 --- src/fileio.c 2010-01-19 12:56:59.000000000 +0100 |
|
117 *************** |
|
118 *** 7072,7079 **** |
|
119 */ |
|
120 for (i = 0; i < (int)(sizeof(tempdirs) / sizeof(char *)); ++i) |
|
121 { |
|
122 - size_t itmplen; |
|
123 # ifndef HAVE_MKDTEMP |
|
124 long nr; |
|
125 long off; |
|
126 # endif |
|
127 --- 7072,7079 ---- |
|
128 */ |
|
129 for (i = 0; i < (int)(sizeof(tempdirs) / sizeof(char *)); ++i) |
|
130 { |
|
131 # ifndef HAVE_MKDTEMP |
|
132 + size_t itmplen; |
|
133 long nr; |
|
134 long off; |
|
135 # endif |
|
136 *************** |
|
137 *** 7091,7097 **** |
|
138 else |
|
139 # endif |
|
140 add_pathsep(itmp); |
|
141 - itmplen = STRLEN(itmp); |
|
142 |
|
143 # ifdef HAVE_MKDTEMP |
|
144 /* Leave room for filename */ |
|
145 --- 7091,7096 ---- |
|
146 *************** |
|
147 *** 7104,7109 **** |
|
148 --- 7103,7109 ---- |
|
149 * otherwise it doesn't matter. The use of mkdir() avoids any |
|
150 * security problems because of the predictable number. */ |
|
151 nr = (mch_get_pid() + (long)time(NULL)) % 1000000L; |
|
152 + itmplen = STRLEN(itmp); |
|
153 |
|
154 /* Try up to 10000 different values until we find a name that |
|
155 * doesn't exist. */ |
|
156 *** ../vim-7.2.332/src/if_cscope.c 2009-07-09 21:22:36.000000000 +0200 |
|
157 --- src/if_cscope.c 2010-01-19 12:57:58.000000000 +0100 |
|
158 *************** |
|
159 *** 2069,2075 **** |
|
160 continue; |
|
161 (void)strcpy(tbuf, matches[idx]); |
|
162 |
|
163 ! if ((fname = strtok(tbuf, (const char *)"\t")) == NULL) |
|
164 continue; |
|
165 if ((fname = strtok(NULL, (const char *)"\t")) == NULL) |
|
166 continue; |
|
167 --- 2069,2075 ---- |
|
168 continue; |
|
169 (void)strcpy(tbuf, matches[idx]); |
|
170 |
|
171 ! if (strtok(tbuf, (const char *)"\t") == NULL) |
|
172 continue; |
|
173 if ((fname = strtok(NULL, (const char *)"\t")) == NULL) |
|
174 continue; |
|
175 *** ../vim-7.2.332/src/netbeans.c 2009-09-11 14:19:41.000000000 +0200 |
|
176 --- src/netbeans.c 2010-01-19 13:57:11.000000000 +0100 |
|
177 *************** |
|
178 *** 873,879 **** |
|
179 { |
|
180 #ifdef NBDEBUG |
|
181 /* |
|
182 ! * This happens because the ExtEd can send a cammand or 2 after |
|
183 * doing a stopDocumentListen command. It doesn't harm anything |
|
184 * so I'm disabling it except for debugging. |
|
185 */ |
|
186 --- 883,889 ---- |
|
187 { |
|
188 #ifdef NBDEBUG |
|
189 /* |
|
190 ! * This happens because the ExtEd can send a command or 2 after |
|
191 * doing a stopDocumentListen command. It doesn't harm anything |
|
192 * so I'm disabling it except for debugging. |
|
193 */ |
|
194 *************** |
|
195 *** 1174,1180 **** |
|
196 break; |
|
197 } |
|
198 } |
|
199 ! *q++ = '\0'; |
|
200 |
|
201 return buf; |
|
202 } |
|
203 --- 1184,1190 ---- |
|
204 break; |
|
205 } |
|
206 } |
|
207 ! *q = '\0'; |
|
208 |
|
209 return buf; |
|
210 } |
|
211 *************** |
|
212 *** 3070,3076 **** |
|
213 } |
|
214 |
|
215 /* |
|
216 ! * Send netbeans an unmodufied command. |
|
217 */ |
|
218 void |
|
219 netbeans_unmodified(buf_T *bufp UNUSED) |
|
220 --- 3080,3086 ---- |
|
221 } |
|
222 |
|
223 /* |
|
224 ! * Send netbeans an unmodified command. |
|
225 */ |
|
226 void |
|
227 netbeans_unmodified(buf_T *bufp UNUSED) |
|
228 *************** |
|
229 *** 3366,3372 **** |
|
230 |
|
231 |
|
232 /* |
|
233 ! * Add a sign of the reqested type at the requested location. |
|
234 * |
|
235 * Reverse engineering: |
|
236 * Apparently an annotation is defined the first time it is used in a buffer. |
|
237 --- 3380,3386 ---- |
|
238 |
|
239 |
|
240 /* |
|
241 ! * Add a sign of the requested type at the requested location. |
|
242 * |
|
243 * Reverse engineering: |
|
244 * Apparently an annotation is defined the first time it is used in a buffer. |
|
245 *** ../vim-7.2.332/src/ops.c 2009-11-25 12:38:49.000000000 +0100 |
|
246 --- src/ops.c 2010-01-19 13:04:46.000000000 +0100 |
|
247 *************** |
|
248 *** 5591,5603 **** |
|
249 */ |
|
250 if (has_mbyte) |
|
251 { |
|
252 - char_u *conv_str = str; |
|
253 vimconv_T vc; |
|
254 |
|
255 vc.vc_type = CONV_NONE; |
|
256 if (convert_setup(&vc, p_enc, (char_u *)"latin1") == OK) |
|
257 { |
|
258 ! int intlen = len; |
|
259 |
|
260 conv_str = string_convert(&vc, str, &intlen); |
|
261 len = intlen; |
|
262 --- 5598,5610 ---- |
|
263 */ |
|
264 if (has_mbyte) |
|
265 { |
|
266 vimconv_T vc; |
|
267 |
|
268 vc.vc_type = CONV_NONE; |
|
269 if (convert_setup(&vc, p_enc, (char_u *)"latin1") == OK) |
|
270 { |
|
271 ! int intlen = len; |
|
272 ! char_u *conv_str; |
|
273 |
|
274 conv_str = string_convert(&vc, str, &intlen); |
|
275 len = intlen; |
|
276 *** ../vim-7.2.332/src/quickfix.c 2009-06-24 17:31:27.000000000 +0200 |
|
277 --- src/quickfix.c 2010-01-19 13:12:29.000000000 +0100 |
|
278 *************** |
|
279 *** 1899,1905 **** |
|
280 int i; |
|
281 int idx1 = 1; |
|
282 int idx2 = -1; |
|
283 - int need_return = TRUE; |
|
284 char_u *arg = eap->arg; |
|
285 int all = eap->forceit; /* if not :cl!, only show |
|
286 recognised errors */ |
|
287 --- 1899,1904 ---- |
|
288 *************** |
|
289 *** 1939,1951 **** |
|
290 { |
|
291 if ((qfp->qf_valid || all) && idx1 <= i && i <= idx2) |
|
292 { |
|
293 ! if (need_return) |
|
294 ! { |
|
295 ! msg_putchar('\n'); |
|
296 ! if (got_int) |
|
297 ! break; |
|
298 ! need_return = FALSE; |
|
299 ! } |
|
300 |
|
301 fname = NULL; |
|
302 if (qfp->qf_fnum != 0 |
|
303 --- 1938,1946 ---- |
|
304 { |
|
305 if ((qfp->qf_valid || all) && idx1 <= i && i <= idx2) |
|
306 { |
|
307 ! msg_putchar('\n'); |
|
308 ! if (got_int) |
|
309 ! break; |
|
310 |
|
311 fname = NULL; |
|
312 if (qfp->qf_fnum != 0 |
|
313 *************** |
|
314 *** 1988,1994 **** |
|
315 IObuff, IOSIZE); |
|
316 msg_prt_line(IObuff, FALSE); |
|
317 out_flush(); /* show one line at a time */ |
|
318 - need_return = TRUE; |
|
319 } |
|
320 |
|
321 qfp = qfp->qf_next; |
|
322 --- 1983,1988 ---- |
|
323 *** ../vim-7.2.332/src/syntax.c 2009-12-16 18:13:04.000000000 +0100 |
|
324 --- src/syntax.c 2010-01-19 13:12:56.000000000 +0100 |
|
325 *************** |
|
326 *** 4167,4173 **** |
|
327 if (!HASHITEM_EMPTY(hi)) |
|
328 { |
|
329 --todo; |
|
330 - kp = HI2KE(hi); |
|
331 for (kp = HI2KE(hi); kp != NULL; kp = kp_next) |
|
332 { |
|
333 kp_next = kp->ke_next; |
|
334 --- 4167,4172 ---- |
|
335 *** ../vim-7.2.332/src/ui.c 2009-09-11 16:48:06.000000000 +0200 |
|
336 --- src/ui.c 2010-01-19 13:14:04.000000000 +0100 |
|
337 *************** |
|
338 *** 2383,2389 **** |
|
339 * 'enc' anyway. */ |
|
340 if (has_mbyte) |
|
341 { |
|
342 ! char_u *conv_buf = buffer; |
|
343 vimconv_T vc; |
|
344 |
|
345 vc.vc_type = CONV_NONE; |
|
346 --- 2383,2389 ---- |
|
347 * 'enc' anyway. */ |
|
348 if (has_mbyte) |
|
349 { |
|
350 ! char_u *conv_buf; |
|
351 vimconv_T vc; |
|
352 |
|
353 vc.vc_type = CONV_NONE; |
|
354 *** ../vim-7.2.332/src/version.c 2010-01-19 13:06:42.000000000 +0100 |
|
355 --- src/version.c 2010-01-19 14:55:50.000000000 +0100 |
|
356 *************** |
|
357 *** 683,684 **** |
|
358 --- 683,686 ---- |
|
359 { /* Add new patch number below this line */ |
|
360 + /**/ |
|
361 + 333, |
|
362 /**/ |
|
363 |
|
364 -- |
|
365 An actual excerpt from a classified section of a city newspaper: |
|
366 "Illiterate? Write today for free help!" |
|
367 |
|
368 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ |
|
369 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
|
370 \\\ download, build and distribute -- http://www.A-A-P.org /// |
|
371 \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |