Problem: A tags file with an extremely long name may cause an infinite loop.
Solution: When encountering a long name switch to linear search.
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;
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;
}
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 373,
/**/
372,
/**/