]> git.pld-linux.org Git - packages/vim.git/blob - 7.3.336
- new
[packages/vim.git] / 7.3.336
1 To: vim_dev@googlegroups.com
2 Subject: Patch 7.3.336
3 Fcc: outbox
4 From: Bram Moolenaar <Bram@moolenaar.net>
5 Mime-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8 ------------
9
10 Patch 7.3.336
11 Problem:    When a tags file specifies an encoding different from 'enc' it
12             may hang and using a pattern doesn't work.
13 Solution:   Convert the whole line.  Continue reading the header after the
14             SORT tag.  Add test83. (Yukihiro Nakadaira)
15 Files:      src/tag.c, src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak,
16             src/testdir/Make_ming.mak, src/testdir/Make_os2.mak,
17             src/testdir/Make_vms.mms, src/testdir/Makefile,
18             src/testdir/test83-tags2, src/testdir/test83-tags3,
19             src/testdir/test83.in, src/testdir/test83.ok
20
21
22 *** ../vim-7.3.335/src/tag.c    2011-04-11 21:35:03.000000000 +0200
23 --- src/tag.c   2011-10-12 19:51:04.000000000 +0200
24 ***************
25 *** 1277,1282 ****
26 --- 1277,1283 ----
27   {
28       FILE       *fp;
29       char_u     *lbuf;                 /* line buffer */
30 +     int               lbuf_size = LSIZE;      /* length of lbuf */
31       char_u     *tag_fname;            /* name of tag file */
32       tagname_T tn;                     /* info for get_tagfname() */
33       int               first_file;             /* trying first tag file */
34 ***************
35 *** 1291,1296 ****
36 --- 1292,1298 ----
37       char_u    *s;
38       int               i;
39   #ifdef FEAT_TAG_BINS
40 +     int               tag_file_sorted = NUL;  /* !_TAG_FILE_SORTED value */
41       struct tag_search_info    /* Binary search file offsets */
42       {
43         off_t   low_offset;     /* offset for first char of first line that
44 ***************
45 *** 1360,1372 ****
46       char_u    *saved_pat = NULL;              /* copy of pat[] */
47   #endif
48   
49 -     /* Use two sets of variables for the pattern: "orgpat" holds the values
50 -      * for the original pattern and "convpat" converted from 'encoding' to
51 -      * encoding of the tags file.  "pats" point to either one of these. */
52 -     pat_T     *pats;
53       pat_T     orgpat;                 /* holds unconverted pattern info */
54   #ifdef FEAT_MBYTE
55 -     pat_T     convpat;                /* holds converted pattern info */
56       vimconv_T vimconv;
57   #endif
58   
59 --- 1362,1369 ----
60 ***************
61 *** 1390,1396 ****
62   
63       help_save = curbuf->b_help;
64       orgpat.pat = pat;
65 -     pats = &orgpat;
66   #ifdef FEAT_MBYTE
67       vimconv.vc_type = CONV_NONE;
68   #endif
69 --- 1387,1392 ----
70 ***************
71 *** 1398,1404 ****
72   /*
73    * Allocate memory for the buffers that are used
74    */
75 !     lbuf = alloc(LSIZE);
76       tag_fname = alloc(MAXPATHL + 1);
77   #ifdef FEAT_EMACS_TAGS
78       ebuf = alloc(LSIZE);
79 --- 1394,1400 ----
80   /*
81    * Allocate memory for the buffers that are used
82    */
83 !     lbuf = alloc(lbuf_size);
84       tag_fname = alloc(MAXPATHL + 1);
85   #ifdef FEAT_EMACS_TAGS
86       ebuf = alloc(LSIZE);
87 ***************
88 *** 1424,1453 ****
89       if (help_only)                            /* want tags from help file */
90         curbuf->b_help = TRUE;                  /* will be restored later */
91   
92 !     pats->len = (int)STRLEN(pat);
93   #ifdef FEAT_MULTI_LANG
94       if (curbuf->b_help)
95       {
96         /* When "@ab" is specified use only the "ab" language, otherwise
97          * search all languages. */
98 !       if (pats->len > 3 && pat[pats->len - 3] == '@'
99 !                                         && ASCII_ISALPHA(pat[pats->len - 2])
100 !                                        && ASCII_ISALPHA(pat[pats->len - 1]))
101         {
102 !           saved_pat = vim_strnsave(pat, pats->len - 3);
103             if (saved_pat != NULL)
104             {
105 !               help_lang_find = &pat[pats->len - 2];
106 !               pats->pat = saved_pat;
107 !               pats->len -= 3;
108             }
109         }
110       }
111   #endif
112 !     if (p_tl != 0 && pats->len > p_tl)                /* adjust for 'taglength' */
113 !       pats->len = p_tl;
114   
115 !     prepare_pats(pats, has_re);
116   
117   #ifdef FEAT_TAG_BINS
118       /* This is only to avoid a compiler warning for using search_info
119 --- 1420,1449 ----
120       if (help_only)                            /* want tags from help file */
121         curbuf->b_help = TRUE;                  /* will be restored later */
122   
123 !     orgpat.len = (int)STRLEN(pat);
124   #ifdef FEAT_MULTI_LANG
125       if (curbuf->b_help)
126       {
127         /* When "@ab" is specified use only the "ab" language, otherwise
128          * search all languages. */
129 !       if (orgpat.len > 3 && pat[orgpat.len - 3] == '@'
130 !                                         && ASCII_ISALPHA(pat[orgpat.len - 2])
131 !                                        && ASCII_ISALPHA(pat[orgpat.len - 1]))
132         {
133 !           saved_pat = vim_strnsave(pat, orgpat.len - 3);
134             if (saved_pat != NULL)
135             {
136 !               help_lang_find = &pat[orgpat.len - 2];
137 !               orgpat.pat = saved_pat;
138 !               orgpat.len -= 3;
139             }
140         }
141       }
142   #endif
143 !     if (p_tl != 0 && orgpat.len > p_tl)               /* adjust for 'taglength' */
144 !       orgpat.len = p_tl;
145   
146 !     prepare_pats(&orgpat, has_re);
147   
148   #ifdef FEAT_TAG_BINS
149       /* This is only to avoid a compiler warning for using search_info
150 ***************
151 *** 1466,1478 ****
152        * Only ignore case when TAG_NOIC not used or 'ignorecase' set.
153        */
154   #ifdef FEAT_TAG_BINS
155 !     pats->regmatch.rm_ic = ((p_ic || !noic)
156 !                               && (findall || pats->headlen == 0 || !p_tbs));
157       for (round = 1; round <= 2; ++round)
158       {
159 !       linear = (pats->headlen == 0 || !p_tbs || round == 2);
160   #else
161 !       pats->regmatch.rm_ic = (p_ic || !noic);
162   #endif
163   
164         /*
165 --- 1462,1474 ----
166        * Only ignore case when TAG_NOIC not used or 'ignorecase' set.
167        */
168   #ifdef FEAT_TAG_BINS
169 !     orgpat.regmatch.rm_ic = ((p_ic || !noic)
170 !                               && (findall || orgpat.headlen == 0 || !p_tbs));
171       for (round = 1; round <= 2; ++round)
172       {
173 !       linear = (orgpat.headlen == 0 || !p_tbs || round == 2);
174   #else
175 !       orgpat.regmatch.rm_ic = (p_ic || !noic);
176   #endif
177   
178         /*
179 ***************
180 *** 1701,1706 ****
181 --- 1697,1732 ----
182             }
183   line_read_in:
184   
185 + #ifdef FEAT_MBYTE
186 +           if (vimconv.vc_type != CONV_NONE)
187 +           {
188 +               char_u  *conv_line;
189 +               int     len;
190
191 +               /* Convert every line.  Converting the pattern from 'enc' to
192 +                * the tags file encoding doesn't work, because characters are
193 +                * not recognized. */
194 +               conv_line = string_convert(&vimconv, lbuf, NULL);
195 +               if (conv_line != NULL)
196 +               {
197 +                   /* Copy or swap lbuf and conv_line. */
198 +                   len = (int)STRLEN(conv_line) + 1;
199 +                   if (len > lbuf_size)
200 +                   {
201 +                       vim_free(lbuf);
202 +                       lbuf = conv_line;
203 +                       lbuf_size = len;
204 +                   }
205 +                   else
206 +                   {
207 +                       STRCPY(lbuf, conv_line);
208 +                       vim_free(conv_line);
209 +                   }
210 +               }
211 +           }
212 + #endif
213
214
215   #ifdef FEAT_EMACS_TAGS
216             /*
217              * Emacs tags line with CTRL-L: New file name on next line.
218 ***************
219 *** 1770,1775 ****
220 --- 1796,1828 ----
221              */
222             if (state == TS_START)
223             {
224 +               if (STRNCMP(lbuf, "!_TAG_", 6) <= 0)
225 +               {
226 +                   /*
227 +                    * Read header line.
228 +                    */
229 + #ifdef FEAT_TAG_BINS
230 +                   if (STRNCMP(lbuf, "!_TAG_FILE_SORTED\t", 18) == 0)
231 +                       tag_file_sorted = lbuf[18];
232 + #endif
233 + #ifdef FEAT_MBYTE
234 +                   if (STRNCMP(lbuf, "!_TAG_FILE_ENCODING\t", 20) == 0)
235 +                   {
236 +                       /* Prepare to convert every line from the specified
237 +                        * encoding to 'encoding'. */
238 +                       for (p = lbuf + 20; *p > ' ' && *p < 127; ++p)
239 +                           ;
240 +                       *p = NUL;
241 +                       convert_setup(&vimconv, lbuf + 20, p_enc);
242 +                   }
243 + #endif
244
245 +                   /* Read the next line.  Unrecognized flags are ignored. */
246 +                   continue;
247 +               }
248
249 +               /* Headers ends. */
250
251   #ifdef FEAT_TAG_BINS
252                 /*
253                  * When there is no tag head, or ignoring case, need to do a
254 ***************
255 *** 1786,1809 ****
256                 if (linear)
257   # endif
258                     state = TS_LINEAR;
259 !               else if (STRNCMP(lbuf, "!_TAG_", 6) > 0)
260                     state = TS_BINARY;
261 !               else if (STRNCMP(lbuf, "!_TAG_FILE_SORTED\t", 18) == 0)
262 !               {
263 !                   /* Check sorted flag */
264 !                   if (lbuf[18] == '1')
265                         state = TS_BINARY;
266 !                   else if (lbuf[18] == '2')
267 !                   {
268 !                       state = TS_BINARY;
269 !                       sortic = TRUE;
270 !                       pats->regmatch.rm_ic = (p_ic || !noic);
271 !                   }
272 !                   else
273 !                       state = TS_LINEAR;
274                 }
275   
276 !               if (state == TS_BINARY && pats->regmatch.rm_ic && !sortic)
277                 {
278                     /* binary search won't work for ignoring case, use linear
279                      * search. */
280 --- 1839,1858 ----
281                 if (linear)
282   # endif
283                     state = TS_LINEAR;
284 !               else if (tag_file_sorted == NUL)
285                     state = TS_BINARY;
286 !               else if (tag_file_sorted == '1')
287                         state = TS_BINARY;
288 !               else if (tag_file_sorted == '2')
289 !               {
290 !                   state = TS_BINARY;
291 !                   sortic = TRUE;
292 !                   orgpat.regmatch.rm_ic = (p_ic || !noic);
293                 }
294 +               else
295 +                   state = TS_LINEAR;
296   
297 !               if (state == TS_BINARY && orgpat.regmatch.rm_ic && !sortic)
298                 {
299                     /* binary search won't work for ignoring case, use linear
300                      * search. */
301 ***************
302 *** 1843,1882 ****
303   #endif
304             }
305   
306 - #ifdef FEAT_MBYTE
307 -           if (lbuf[0] == '!' && pats == &orgpat
308 -                          && STRNCMP(lbuf, "!_TAG_FILE_ENCODING\t", 20) == 0)
309 -           {
310 -               /* Convert the search pattern from 'encoding' to the
311 -                * specified encoding. */
312 -               for (p = lbuf + 20; *p > ' ' && *p < 127; ++p)
313 -                   ;
314 -               *p = NUL;
315 -               convert_setup(&vimconv, p_enc, lbuf + 20);
316 -               if (vimconv.vc_type != CONV_NONE)
317 -               {
318 -                   convpat.pat = string_convert(&vimconv, pats->pat, NULL);
319 -                   if (convpat.pat != NULL)
320 -                   {
321 -                       pats = &convpat;
322 -                       pats->len = (int)STRLEN(pats->pat);
323 -                       prepare_pats(pats, has_re);
324 -                       pats->regmatch.rm_ic = orgpat.regmatch.rm_ic;
325 -                   }
326 -               }
327
328 -               /* Prepare for converting a match the other way around. */
329 -               convert_setup(&vimconv, lbuf + 20, p_enc);
330 -               continue;
331 -           }
332 - #endif
333
334             /*
335              * Figure out where the different strings are in this line.
336              * For "normal" tags: Do a quick check if the tag matches.
337              * This speeds up tag searching a lot!
338              */
339 !           if (pats->headlen
340   #ifdef FEAT_EMACS_TAGS
341                             && !is_etag
342   #endif
343 --- 1892,1903 ----
344   #endif
345             }
346   
347             /*
348              * Figure out where the different strings are in this line.
349              * For "normal" tags: Do a quick check if the tag matches.
350              * This speeds up tag searching a lot!
351              */
352 !           if (orgpat.headlen
353   #ifdef FEAT_EMACS_TAGS
354                             && !is_etag
355   #endif
356 ***************
357 *** 1933,1941 ****
358                 cmplen = (int)(tagp.tagname_end - tagp.tagname);
359                 if (p_tl != 0 && cmplen > p_tl)     /* adjust for 'taglength' */
360                     cmplen = p_tl;
361 !               if (has_re && pats->headlen < cmplen)
362 !                   cmplen = pats->headlen;
363 !               else if (state == TS_LINEAR && pats->headlen != cmplen)
364                     continue;
365   
366   #ifdef FEAT_TAG_BINS
367 --- 1954,1962 ----
368                 cmplen = (int)(tagp.tagname_end - tagp.tagname);
369                 if (p_tl != 0 && cmplen > p_tl)     /* adjust for 'taglength' */
370                     cmplen = p_tl;
371 !               if (has_re && orgpat.headlen < cmplen)
372 !                   cmplen = orgpat.headlen;
373 !               else if (state == TS_LINEAR && orgpat.headlen != cmplen)
374                     continue;
375   
376   #ifdef FEAT_TAG_BINS
377 ***************
378 *** 1954,1963 ****
379                      * Compare the current tag with the searched tag.
380                      */
381                     if (sortic)
382 !                       tagcmp = tag_strnicmp(tagp.tagname, pats->head,
383                                                               (size_t)cmplen);
384                     else
385 !                       tagcmp = STRNCMP(tagp.tagname, pats->head, cmplen);
386   
387                     /*
388                      * A match with a shorter tag means to search forward.
389 --- 1975,1984 ----
390                      * Compare the current tag with the searched tag.
391                      */
392                     if (sortic)
393 !                       tagcmp = tag_strnicmp(tagp.tagname, orgpat.head,
394                                                               (size_t)cmplen);
395                     else
396 !                       tagcmp = STRNCMP(tagp.tagname, orgpat.head, cmplen);
397   
398                     /*
399                      * A match with a shorter tag means to search forward.
400 ***************
401 *** 1965,1973 ****
402                      */
403                     if (tagcmp == 0)
404                     {
405 !                       if (cmplen < pats->headlen)
406                             tagcmp = -1;
407 !                       else if (cmplen > pats->headlen)
408                             tagcmp = 1;
409                     }
410   
411 --- 1986,1994 ----
412                      */
413                     if (tagcmp == 0)
414                     {
415 !                       if (cmplen < orgpat.headlen)
416                             tagcmp = -1;
417 !                       else if (cmplen > orgpat.headlen)
418                             tagcmp = 1;
419                     }
420   
421 ***************
422 *** 2011,2017 ****
423                 }
424                 else if (state == TS_SKIP_BACK)
425                 {
426 !                   if (MB_STRNICMP(tagp.tagname, pats->head, cmplen) != 0)
427                         state = TS_STEP_FORWARD;
428                     else
429                         /* Have to skip back more.  Restore the curr_offset
430 --- 2032,2038 ----
431                 }
432                 else if (state == TS_SKIP_BACK)
433                 {
434 !                   if (MB_STRNICMP(tagp.tagname, orgpat.head, cmplen) != 0)
435                         state = TS_STEP_FORWARD;
436                     else
437                         /* Have to skip back more.  Restore the curr_offset
438 ***************
439 *** 2021,2027 ****
440                 }
441                 else if (state == TS_STEP_FORWARD)
442                 {
443 !                   if (MB_STRNICMP(tagp.tagname, pats->head, cmplen) != 0)
444                     {
445                         if ((off_t)ftell(fp) > search_info.match_offset)
446                             break;      /* past last match */
447 --- 2042,2048 ----
448                 }
449                 else if (state == TS_STEP_FORWARD)
450                 {
451 !                   if (MB_STRNICMP(tagp.tagname, orgpat.head, cmplen) != 0)
452                     {
453                         if ((off_t)ftell(fp) > search_info.match_offset)
454                             break;      /* past last match */
455 ***************
456 *** 2032,2038 ****
457                 else
458   #endif
459                     /* skip this match if it can't match */
460 !                   if (MB_STRNICMP(tagp.tagname, pats->head, cmplen) != 0)
461                     continue;
462   
463                 /*
464 --- 2053,2059 ----
465                 else
466   #endif
467                     /* skip this match if it can't match */
468 !                   if (MB_STRNICMP(tagp.tagname, orgpat.head, cmplen) != 0)
469                     continue;
470   
471                 /*
472 ***************
473 *** 2083,2123 ****
474             if (p_tl != 0 && cmplen > p_tl)         /* adjust for 'taglength' */
475                 cmplen = p_tl;
476             /* if tag length does not match, don't try comparing */
477 !           if (pats->len != cmplen)
478                 match = FALSE;
479             else
480             {
481 !               if (pats->regmatch.rm_ic)
482                 {
483 !                   match = (MB_STRNICMP(tagp.tagname, pats->pat, cmplen) == 0);
484                     if (match)
485 !                       match_no_ic = (STRNCMP(tagp.tagname, pats->pat,
486                                                                 cmplen) == 0);
487                 }
488                 else
489 !                   match = (STRNCMP(tagp.tagname, pats->pat, cmplen) == 0);
490             }
491   
492             /*
493              * Has a regexp: Also find tags matching regexp.
494              */
495             match_re = FALSE;
496 !           if (!match && pats->regmatch.regprog != NULL)
497             {
498                 int     cc;
499   
500                 cc = *tagp.tagname_end;
501                 *tagp.tagname_end = NUL;
502 !               match = vim_regexec(&pats->regmatch, tagp.tagname, (colnr_T)0);
503                 if (match)
504                 {
505 !                   matchoff = (int)(pats->regmatch.startp[0] - tagp.tagname);
506 !                   if (pats->regmatch.rm_ic)
507                     {
508 !                       pats->regmatch.rm_ic = FALSE;
509 !                       match_no_ic = vim_regexec(&pats->regmatch, tagp.tagname,
510                                                                   (colnr_T)0);
511 !                       pats->regmatch.rm_ic = TRUE;
512                     }
513                 }
514                 *tagp.tagname_end = cc;
515 --- 2104,2144 ----
516             if (p_tl != 0 && cmplen > p_tl)         /* adjust for 'taglength' */
517                 cmplen = p_tl;
518             /* if tag length does not match, don't try comparing */
519 !           if (orgpat.len != cmplen)
520                 match = FALSE;
521             else
522             {
523 !               if (orgpat.regmatch.rm_ic)
524                 {
525 !                   match = (MB_STRNICMP(tagp.tagname, orgpat.pat, cmplen) == 0);
526                     if (match)
527 !                       match_no_ic = (STRNCMP(tagp.tagname, orgpat.pat,
528                                                                 cmplen) == 0);
529                 }
530                 else
531 !                   match = (STRNCMP(tagp.tagname, orgpat.pat, cmplen) == 0);
532             }
533   
534             /*
535              * Has a regexp: Also find tags matching regexp.
536              */
537             match_re = FALSE;
538 !           if (!match && orgpat.regmatch.regprog != NULL)
539             {
540                 int     cc;
541   
542                 cc = *tagp.tagname_end;
543                 *tagp.tagname_end = NUL;
544 !               match = vim_regexec(&orgpat.regmatch, tagp.tagname, (colnr_T)0);
545                 if (match)
546                 {
547 !                   matchoff = (int)(orgpat.regmatch.startp[0] - tagp.tagname);
548 !                   if (orgpat.regmatch.rm_ic)
549                     {
550 !                       orgpat.regmatch.rm_ic = FALSE;
551 !                       match_no_ic = vim_regexec(&orgpat.regmatch, tagp.tagname,
552                                                                   (colnr_T)0);
553 !                       orgpat.regmatch.rm_ic = TRUE;
554                     }
555                 }
556                 *tagp.tagname_end = cc;
557 ***************
558 *** 2174,2180 ****
559                         else
560                             mtt = MT_GL_OTH;
561                     }
562 !                   if (pats->regmatch.rm_ic && !match_no_ic)
563                         mtt += MT_IC_OFF;
564                     if (match_re)
565                         mtt += MT_RE_OFF;
566 --- 2195,2201 ----
567                         else
568                             mtt = MT_GL_OTH;
569                     }
570 !                   if (orgpat.regmatch.rm_ic && !match_no_ic)
571                         mtt += MT_IC_OFF;
572                     if (match_re)
573                         mtt += MT_RE_OFF;
574 ***************
575 *** 2187,2221 ****
576                  */
577                 if (ga_grow(&ga_match[mtt], 1) == OK)
578                 {
579 - #ifdef FEAT_MBYTE
580 -                   char_u      *conv_line = NULL;
581 -                   char_u      *lbuf_line = lbuf;
582
583 -                   if (vimconv.vc_type != CONV_NONE)
584 -                   {
585 -                       /* Convert the tag line from the encoding of the tags
586 -                        * file to 'encoding'.  Then parse the line again. */
587 -                       conv_line = string_convert(&vimconv, lbuf, NULL);
588 -                       if (conv_line != NULL)
589 -                       {
590 -                           if (parse_tag_line(conv_line,
591 - #ifdef FEAT_EMACS_TAGS
592 -                                       is_etag,
593 - #endif
594 -                                       &tagp) == OK)
595 -                               lbuf_line = conv_line;
596 -                           else
597 -                               /* doesn't work, go back to unconverted line. */
598 -                               (void)parse_tag_line(lbuf,
599 - #ifdef FEAT_EMACS_TAGS
600 -                                                    is_etag,
601 - #endif
602 -                                                    &tagp);
603 -                       }
604 -                   }
605 - #else
606 - # define lbuf_line lbuf
607 - #endif
608                     if (help_only)
609                     {
610   #ifdef FEAT_MULTI_LANG
611 --- 2208,2213 ----
612 ***************
613 *** 2307,2313 ****
614                          * without Emacs tags: <mtt><tag_fname><NUL><lbuf>
615                          */
616                         len = (int)STRLEN(tag_fname)
617 !                                                + (int)STRLEN(lbuf_line) + 3;
618   #ifdef FEAT_EMACS_TAGS
619                         if (is_etag)
620                             len += (int)STRLEN(ebuf) + 1;
621 --- 2299,2305 ----
622                          * without Emacs tags: <mtt><tag_fname><NUL><lbuf>
623                          */
624                         len = (int)STRLEN(tag_fname)
625 !                                                + (int)STRLEN(lbuf) + 3;
626   #ifdef FEAT_EMACS_TAGS
627                         if (is_etag)
628                             len += (int)STRLEN(ebuf) + 1;
629 ***************
630 *** 2337,2343 ****
631                             else
632                                 *s++ = NUL;
633   #endif
634 !                           STRCPY(s, lbuf_line);
635                         }
636                     }
637   
638 --- 2329,2335 ----
639                             else
640                                 *s++ = NUL;
641   #endif
642 !                           STRCPY(s, lbuf);
643                         }
644                     }
645   
646 ***************
647 *** 2373,2382 ****
648                         else
649                             vim_free(mfp);
650                     }
651 - #ifdef FEAT_MBYTE
652 -                   /* Note: this makes the values in "tagp" invalid! */
653 -                   vim_free(conv_line);
654 - #endif
655                 }
656                 else    /* Out of memory! Just forget about the rest. */
657                 {
658 --- 2365,2370 ----
659 ***************
660 *** 2415,2433 ****
661         }
662   #endif
663   #ifdef FEAT_MBYTE
664 -       if (pats == &convpat)
665 -       {
666 -           /* Go back from converted pattern to original pattern. */
667 -           vim_free(pats->pat);
668 -           vim_free(pats->regmatch.regprog);
669 -           orgpat.regmatch.rm_ic = pats->regmatch.rm_ic;
670 -           pats = &orgpat;
671 -       }
672         if (vimconv.vc_type != CONV_NONE)
673             convert_setup(&vimconv, NULL, NULL);
674   #endif
675   
676   #ifdef FEAT_TAG_BINS
677         if (sort_error)
678         {
679             EMSG2(_("E432: Tags file not sorted: %s"), tag_fname);
680 --- 2403,2414 ----
681         }
682   #endif
683   #ifdef FEAT_MBYTE
684         if (vimconv.vc_type != CONV_NONE)
685             convert_setup(&vimconv, NULL, NULL);
686   #endif
687   
688   #ifdef FEAT_TAG_BINS
689 +       tag_file_sorted = NUL;
690         if (sort_error)
691         {
692             EMSG2(_("E432: Tags file not sorted: %s"), tag_fname);
693 ***************
694 *** 2461,2473 ****
695   #ifdef FEAT_TAG_BINS
696         /* stop searching when already did a linear search, or when TAG_NOIC
697          * used, and 'ignorecase' not set or already did case-ignore search */
698 !       if (stop_searching || linear || (!p_ic && noic) || pats->regmatch.rm_ic)
699           break;
700   # ifdef FEAT_CSCOPE
701         if (use_cscope)
702           break;
703   # endif
704 !       pats->regmatch.rm_ic = TRUE;    /* try another time while ignoring case */
705       }
706   #endif
707   
708 --- 2442,2454 ----
709   #ifdef FEAT_TAG_BINS
710         /* stop searching when already did a linear search, or when TAG_NOIC
711          * used, and 'ignorecase' not set or already did case-ignore search */
712 !       if (stop_searching || linear || (!p_ic && noic) || orgpat.regmatch.rm_ic)
713           break;
714   # ifdef FEAT_CSCOPE
715         if (use_cscope)
716           break;
717   # endif
718 !       orgpat.regmatch.rm_ic = TRUE;   /* try another time while ignoring case */
719       }
720   #endif
721   
722 ***************
723 *** 2480,2486 ****
724   
725   findtag_end:
726       vim_free(lbuf);
727 !     vim_free(pats->regmatch.regprog);
728       vim_free(tag_fname);
729   #ifdef FEAT_EMACS_TAGS
730       vim_free(ebuf);
731 --- 2461,2467 ----
732   
733   findtag_end:
734       vim_free(lbuf);
735 !     vim_free(orgpat.regmatch.regprog);
736       vim_free(tag_fname);
737   #ifdef FEAT_EMACS_TAGS
738       vim_free(ebuf);
739 *** ../vim-7.3.335/src/testdir/Make_amiga.mak   2011-07-15 21:16:54.000000000 +0200
740 --- src/testdir/Make_amiga.mak  2011-10-12 19:21:00.000000000 +0200
741 ***************
742 *** 29,35 ****
743                 test66.out test67.out test68.out test69.out test70.out \
744                 test71.out test72.out test73.out test74.out test75.out \
745                 test76.out test77.out test78.out test79.out test80.out \
746 !               test81.out test82.out
747   
748   .SUFFIXES: .in .out
749   
750 --- 29,35 ----
751                 test66.out test67.out test68.out test69.out test70.out \
752                 test71.out test72.out test73.out test74.out test75.out \
753                 test76.out test77.out test78.out test79.out test80.out \
754 !               test81.out test82.out test83.out
755   
756   .SUFFIXES: .in .out
757   
758 ***************
759 *** 131,133 ****
760 --- 131,134 ----
761   test80.out: test80.in
762   test81.out: test81.in
763   test82.out: test82.in
764 + test83.out: test83.in
765 *** ../vim-7.3.335/src/testdir/Make_dos.mak     2011-07-15 21:16:54.000000000 +0200
766 --- src/testdir/Make_dos.mak    2011-10-12 17:39:03.000000000 +0200
767 ***************
768 *** 29,35 ****
769                 test42.out test52.out test65.out test66.out test67.out \
770                 test68.out test69.out test71.out test72.out test73.out \
771                 test74.out test75.out test76.out test77.out test78.out \
772 !               test79.out test80.out test81.out test82.out
773   
774   SCRIPTS32 =   test50.out test70.out
775   
776 --- 29,35 ----
777                 test42.out test52.out test65.out test66.out test67.out \
778                 test68.out test69.out test71.out test72.out test73.out \
779                 test74.out test75.out test76.out test77.out test78.out \
780 !               test79.out test80.out test81.out test82.out test83.out
781   
782   SCRIPTS32 =   test50.out test70.out
783   
784 *** ../vim-7.3.335/src/testdir/Make_ming.mak    2011-07-15 21:16:54.000000000 +0200
785 --- src/testdir/Make_ming.mak   2011-10-12 17:39:03.000000000 +0200
786 ***************
787 *** 49,55 ****
788                 test42.out test52.out test65.out test66.out test67.out \
789                 test68.out test69.out test71.out test72.out test73.out \
790                 test74.out test75.out test76.out test77.out test78.out \
791 !               test79.out test80.out test81.out test82.out
792   
793   SCRIPTS32 =   test50.out test70.out
794   
795 --- 49,55 ----
796                 test42.out test52.out test65.out test66.out test67.out \
797                 test68.out test69.out test71.out test72.out test73.out \
798                 test74.out test75.out test76.out test77.out test78.out \
799 !               test79.out test80.out test81.out test82.out test83.out
800   
801   SCRIPTS32 =   test50.out test70.out
802   
803 *** ../vim-7.3.335/src/testdir/Make_os2.mak     2011-07-15 21:16:54.000000000 +0200
804 --- src/testdir/Make_os2.mak    2011-10-12 17:39:03.000000000 +0200
805 ***************
806 *** 29,35 ****
807                 test66.out test67.out test68.out test69.out test70.out \
808                 test71.out test72.out test73.out test74.out test75.out \
809                 test76.out test77.out test78.out test79.out test80.out \
810 !               test81.out test82.out
811   
812   .SUFFIXES: .in .out
813   
814 --- 29,35 ----
815                 test66.out test67.out test68.out test69.out test70.out \
816                 test71.out test72.out test73.out test74.out test75.out \
817                 test76.out test77.out test78.out test79.out test80.out \
818 !               test81.out test82.out test83.out
819   
820   .SUFFIXES: .in .out
821   
822 *** ../vim-7.3.335/src/testdir/Make_vms.mms     2011-07-15 21:16:54.000000000 +0200
823 --- src/testdir/Make_vms.mms    2011-10-12 17:39:03.000000000 +0200
824 ***************
825 *** 76,82 ****
826          test66.out test67.out test68.out test69.out \
827          test71.out test72.out test74.out test75.out test76.out \
828          test77.out test78.out test79.out test80.out test81.out \
829 !        test82.out
830   
831   # Known problems:
832   # Test 30: a problem around mac format - unknown reason
833 --- 76,82 ----
834          test66.out test67.out test68.out test69.out \
835          test71.out test72.out test74.out test75.out test76.out \
836          test77.out test78.out test79.out test80.out test81.out \
837 !        test82.out test83.out
838   
839   # Known problems:
840   # Test 30: a problem around mac format - unknown reason
841 *** ../vim-7.3.335/src/testdir/Makefile 2011-07-15 21:16:54.000000000 +0200
842 --- src/testdir/Makefile        2011-10-12 17:39:03.000000000 +0200
843 ***************
844 *** 26,32 ****
845                 test64.out test65.out test66.out test67.out test68.out \
846                 test69.out test70.out test71.out test72.out test73.out \
847                 test74.out test75.out test76.out test77.out test78.out \
848 !               test79.out test80.out test81.out test82.out
849   
850   SCRIPTS_GUI = test16.out
851   
852 --- 26,32 ----
853                 test64.out test65.out test66.out test67.out test68.out \
854                 test69.out test70.out test71.out test72.out test73.out \
855                 test74.out test75.out test76.out test77.out test78.out \
856 !               test79.out test80.out test81.out test82.out test83.out
857   
858   SCRIPTS_GUI = test16.out
859   
860 ***************
861 *** 72,78 ****
862                   fi \
863                 else echo $* NO OUTPUT >>test.log; \
864                 fi"
865 !       -rm -rf X* test.ok viminfo
866   
867   test49.out: test49.vim
868   
869 --- 72,78 ----
870                   fi \
871                 else echo $* NO OUTPUT >>test.log; \
872                 fi"
873 ! #     -rm -rf X* test.ok viminfo
874   
875   test49.out: test49.vim
876   
877 *** ../vim-7.3.335/src/testdir/test83-tags2     2011-10-12 19:49:38.000000000 +0200
878 --- src/testdir/test83-tags2    2011-10-12 19:34:15.000000000 +0200
879 ***************
880 *** 0 ****
881 --- 1,2 ----
882 + !_TAG_FILE_ENCODING   cp932   //
883\82`\82a\82b     Xtags2.txt      /\82`\82a\82b
884 *** ../vim-7.3.335/src/testdir/test83-tags3     2011-10-12 19:49:38.000000000 +0200
885 --- src/testdir/test83-tags3    2011-10-12 19:35:42.000000000 +0200
886 ***************
887 *** 0 ****
888 --- 1,102 ----
889 + !_TAG_FILE_SORTED     1       //
890 + !_TAG_FILE_ENCODING   cp932   //
891 + abc1  Xtags3.txt      /\82`\82a\82b
892 + abc2  Xtags3.txt      /\82`\82a\82b
893 + abc3  Xtags3.txt      /\82`\82a\82b
894 + abc4  Xtags3.txt      /\82`\82a\82b
895 + abc5  Xtags3.txt      /\82`\82a\82b
896 + abc6  Xtags3.txt      /\82`\82a\82b
897 + abc7  Xtags3.txt      /\82`\82a\82b
898 + abc8  Xtags3.txt      /\82`\82a\82b
899 + abc9  Xtags3.txt      /\82`\82a\82b
900 + abc10 Xtags3.txt      /\82`\82a\82b
901 + abc11 Xtags3.txt      /\82`\82a\82b
902 + abc12 Xtags3.txt      /\82`\82a\82b
903 + abc13 Xtags3.txt      /\82`\82a\82b
904 + abc14 Xtags3.txt      /\82`\82a\82b
905 + abc15 Xtags3.txt      /\82`\82a\82b
906 + abc16 Xtags3.txt      /\82`\82a\82b
907 + abc17 Xtags3.txt      /\82`\82a\82b
908 + abc18 Xtags3.txt      /\82`\82a\82b
909 + abc19 Xtags3.txt      /\82`\82a\82b
910 + abc20 Xtags3.txt      /\82`\82a\82b
911 + abc21 Xtags3.txt      /\82`\82a\82b
912 + abc22 Xtags3.txt      /\82`\82a\82b
913 + abc23 Xtags3.txt      /\82`\82a\82b
914 + abc24 Xtags3.txt      /\82`\82a\82b
915 + abc25 Xtags3.txt      /\82`\82a\82b
916 + abc26 Xtags3.txt      /\82`\82a\82b
917 + abc27 Xtags3.txt      /\82`\82a\82b
918 + abc28 Xtags3.txt      /\82`\82a\82b
919 + abc29 Xtags3.txt      /\82`\82a\82b
920 + abc30 Xtags3.txt      /\82`\82a\82b
921 + abc31 Xtags3.txt      /\82`\82a\82b
922 + abc32 Xtags3.txt      /\82`\82a\82b
923 + abc33 Xtags3.txt      /\82`\82a\82b
924 + abc34 Xtags3.txt      /\82`\82a\82b
925 + abc35 Xtags3.txt      /\82`\82a\82b
926 + abc36 Xtags3.txt      /\82`\82a\82b
927 + abc37 Xtags3.txt      /\82`\82a\82b
928 + abc38 Xtags3.txt      /\82`\82a\82b
929 + abc39 Xtags3.txt      /\82`\82a\82b
930 + abc40 Xtags3.txt      /\82`\82a\82b
931 + abc41 Xtags3.txt      /\82`\82a\82b
932 + abc42 Xtags3.txt      /\82`\82a\82b
933 + abc43 Xtags3.txt      /\82`\82a\82b
934 + abc44 Xtags3.txt      /\82`\82a\82b
935 + abc45 Xtags3.txt      /\82`\82a\82b
936 + abc46 Xtags3.txt      /\82`\82a\82b
937 + abc47 Xtags3.txt      /\82`\82a\82b
938 + abc48 Xtags3.txt      /\82`\82a\82b
939 + abc49 Xtags3.txt      /\82`\82a\82b
940 + abc50 Xtags3.txt      /\82`\82a\82b
941 + abc51 Xtags3.txt      /\82`\82a\82b
942 + abc52 Xtags3.txt      /\82`\82a\82b
943 + abc53 Xtags3.txt      /\82`\82a\82b
944 + abc54 Xtags3.txt      /\82`\82a\82b
945 + abc55 Xtags3.txt      /\82`\82a\82b
946 + abc56 Xtags3.txt      /\82`\82a\82b
947 + abc57 Xtags3.txt      /\82`\82a\82b
948 + abc58 Xtags3.txt      /\82`\82a\82b
949 + abc59 Xtags3.txt      /\82`\82a\82b
950 + abc60 Xtags3.txt      /\82`\82a\82b
951 + abc61 Xtags3.txt      /\82`\82a\82b
952 + abc62 Xtags3.txt      /\82`\82a\82b
953 + abc63 Xtags3.txt      /\82`\82a\82b
954 + abc64 Xtags3.txt      /\82`\82a\82b
955 + abc65 Xtags3.txt      /\82`\82a\82b
956 + abc66 Xtags3.txt      /\82`\82a\82b
957 + abc67 Xtags3.txt      /\82`\82a\82b
958 + abc68 Xtags3.txt      /\82`\82a\82b
959 + abc69 Xtags3.txt      /\82`\82a\82b
960 + abc70 Xtags3.txt      /\82`\82a\82b
961 + abc71 Xtags3.txt      /\82`\82a\82b
962 + abc72 Xtags3.txt      /\82`\82a\82b
963 + abc73 Xtags3.txt      /\82`\82a\82b
964 + abc74 Xtags3.txt      /\82`\82a\82b
965 + abc75 Xtags3.txt      /\82`\82a\82b
966 + abc76 Xtags3.txt      /\82`\82a\82b
967 + abc77 Xtags3.txt      /\82`\82a\82b
968 + abc78 Xtags3.txt      /\82`\82a\82b
969 + abc79 Xtags3.txt      /\82`\82a\82b
970 + abc80 Xtags3.txt      /\82`\82a\82b
971 + abc81 Xtags3.txt      /\82`\82a\82b
972 + abc82 Xtags3.txt      /\82`\82a\82b
973 + abc83 Xtags3.txt      /\82`\82a\82b
974 + abc84 Xtags3.txt      /\82`\82a\82b
975 + abc85 Xtags3.txt      /\82`\82a\82b
976 + abc86 Xtags3.txt      /\82`\82a\82b
977 + abc87 Xtags3.txt      /\82`\82a\82b
978 + abc88 Xtags3.txt      /\82`\82a\82b
979 + abc89 Xtags3.txt      /\82`\82a\82b
980 + abc90 Xtags3.txt      /\82`\82a\82b
981 + abc91 Xtags3.txt      /\82`\82a\82b
982 + abc92 Xtags3.txt      /\82`\82a\82b
983 + abc93 Xtags3.txt      /\82`\82a\82b
984 + abc94 Xtags3.txt      /\82`\82a\82b
985 + abc95 Xtags3.txt      /\82`\82a\82b
986 + abc96 Xtags3.txt      /\82`\82a\82b
987 + abc97 Xtags3.txt      /\82`\82a\82b
988 + abc98 Xtags3.txt      /\82`\82a\82b
989 + abc99 Xtags3.txt      /\82`\82a\82b
990 + abc100        Xtags3.txt      /\82`\82a\82b
991 *** ../vim-7.3.335/src/testdir/test83.in        2011-10-12 19:49:38.000000000 +0200
992 --- src/testdir/test83.in       2011-10-12 19:40:47.000000000 +0200
993 ***************
994 *** 0 ****
995 --- 1,76 ----
996 + Tests for tag search with !_TAG_FILE_ENCODING.
997
998 + STARTTEST
999 + :so mbyte.vim
1000 + :if !has('iconv')
1001 + : e! test.ok
1002 + : w! test.out
1003 + : qa!
1004 + :endif
1005 + :set enc=utf8
1006
1007 + :/^text for tags1$/,/^text for tags1$/+1w! Xtags1.txt
1008 + :/^text for tags2$/,/^text for tags2$/+1w! Xtags2.txt
1009 + :/^text for tags3$/,/^text for tags3$/+1w! Xtags3.txt
1010 + :/^tags1$/+1,/^tags1-end$/-1w! Xtags1
1011
1012 + ggdG
1013
1014 + :call setline('.', 'Results of test83')
1015
1016 + :" case1:
1017 + :new
1018 + :set tags=Xtags1
1019 + :let v:errmsg = ''
1020 + :tag abcdefghijklmnopqrs
1021 + :if v:errmsg =~ 'E426:' || getline('.') != 'abcdefghijklmnopqrs'
1022 + : close
1023 + : put ='case1: failed'
1024 + :else
1025 + : close
1026 + : put ='case1: ok'
1027 + :endif
1028
1029 + :" case2:
1030 + :new
1031 + :set tags=test83-tags2
1032 + :let v:errmsg = ''
1033 + :tag /.BC
1034 + :if v:errmsg =~ 'E426:' || getline('.') != 'ABC'
1035 + : close
1036 + : put ='case2: failed'
1037 + :else
1038 + : close
1039 + : put ='case2: ok'
1040 + :endif
1041
1042 + :" case3:
1043 + :new
1044 + :set tags=test83-tags3
1045 + :let v:errmsg = ''
1046 + :tag abc50
1047 + :if v:errmsg =~ 'E426:' || getline('.') != 'ABC'
1048 + : close
1049 + : put ='case3: failed'
1050 + :else
1051 + : close
1052 + : put ='case3: ok'
1053 + :endif
1054 + :close
1055
1056 + :wq! test.out
1057 + ENDTEST
1058
1059 + text for tags1
1060 + abcdefghijklmnopqrs
1061
1062 + text for tags2
1063 + ï¼¡ï¼¢ï¼£
1064
1065 + text for tags3
1066 + ï¼¡ï¼¢ï¼£
1067
1068 + tags1
1069 + !_TAG_FILE_ENCODING   utf-8   //
1070 + abcdefghijklmnopqrs   Xtags1.txt      /abcdefghijklmnopqrs
1071 + tags1-end
1072 *** ../vim-7.3.335/src/testdir/test83.ok        2011-10-12 19:49:38.000000000 +0200
1073 --- src/testdir/test83.ok       2011-10-12 17:39:03.000000000 +0200
1074 ***************
1075 *** 0 ****
1076 --- 1,4 ----
1077 + Results of test83
1078 + case1: ok
1079 + case2: ok
1080 + case3: ok
1081 *** ../vim-7.3.335/src/version.c        2011-10-12 16:57:07.000000000 +0200
1082 --- src/version.c       2011-10-12 19:45:46.000000000 +0200
1083 ***************
1084 *** 711,712 ****
1085 --- 711,714 ----
1086   {   /* Add new patch number below this line */
1087 + /**/
1088 +     336,
1089   /**/
1090
1091
1092 -- 
1093 hundred-and-one symptoms of being an internet addict:
1094 62. If your doorbell rings, you think that new mail has arrived.  And then
1095     you're disappointed that it's only someone at the door.
1096
1097  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
1098 ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
1099 \\\  an exciting new programming language -- http://www.Zimbu.org        ///
1100  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
This page took 0.106323 seconds and 3 git commands to generate.