]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.373 v7.3.373
authorBram Moolenaar <Bram@vim.org>
Wed, 14 Dec 2011 13:15:16 +0000 (14:15 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 14 Dec 2011 13:15:16 +0000 (14:15 +0100)
Problem:    A tags file with an extremely long name may cause an infinite loop.
Solution:   When encountering a long name switch to linear search.

src/tag.c
src/version.c

index f9738ef03252bcf8e785127ba63dbaf06574f4c1..41c7c582e7793f5526d791bdd98d8206303e9bd1 100644 (file)
--- a/src/tag.c
+++ b/src/tag.c
@@ -1854,7 +1854,7 @@ line_read_in:
 
                if (state == TS_BINARY && orgpat.regmatch.rm_ic && !sortic)
                {
-                   /* binary search won't work for ignoring case, use linear
+                   /* Binary search won't work for ignoring case, use linear
                     * search. */
                    linear = TRUE;
                    state = TS_LINEAR;
@@ -1922,6 +1922,19 @@ line_read_in:
                            MSG(_("Ignoring long line in tags file"));
                            verbose_leave();
                        }
+#ifdef FEAT_TAG_BINS
+                       if (state != TS_LINEAR)
+                       {
+                           /* Avoid getting stuck. */
+                           linear = TRUE;
+                           state = TS_LINEAR;
+# ifdef HAVE_FSEEKO
+                           fseeko(fp, search_info.low_offset, SEEK_SET);
+# else
+                           fseek(fp, (long)search_info.low_offset, SEEK_SET);
+# endif
+                       }
+#endif
                        continue;
                    }
 
index e2f60f61ca0e9ae24928fea34c8131011f11ee89..af276df8fe7f3bbbfd8d3f5d46237662ffaec2fc 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    373,
 /**/
     372,
 /**/