Mercurial > vim
changeset 3206:a1d2f741d45c v7.3.373
updated for version 7.3.373
Problem: A tags file with an extremely long name may cause an infinite loop.
Solution: When encountering a long name switch to linear search.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 14 Dec 2011 14:15:16 +0100 |
parents | cc606937e937 |
children | 13324669e79b |
files | src/tag.c src/version.c |
diffstat | 2 files changed, 16 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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; }