changeset 3192:436b42f3cba1 v7.3.366

updated for version 7.3.366 Problem: A tags file with an extremely long name causes errors. Solution: Ignore tags that are too long. (Arno Renevier)
author Bram Moolenaar <bram@vim.org>
date Thu, 08 Dec 2011 15:12:11 +0100
parents b39a3d8a7a0a
children 4f75e3e54ff3
files src/tag.c src/version.c
diffstat 2 files changed, 18 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/tag.c
+++ b/src/tag.c
@@ -1906,12 +1906,26 @@ line_read_in:
 		tagp.tagname = lbuf;
 #ifdef FEAT_TAG_ANYWHITE
 		tagp.tagname_end = skiptowhite(lbuf);
-		if (*tagp.tagname_end == NUL)	    /* corrupted tag line */
+		if (*tagp.tagname_end == NUL)
 #else
 		tagp.tagname_end = vim_strchr(lbuf, TAB);
-		if (tagp.tagname_end == NULL)	    /* corrupted tag line */
+		if (tagp.tagname_end == NULL)
 #endif
 		{
+		    if (vim_strchr(lbuf, NL) == NULL)
+		    {
+			/* Truncated line, ignore it.  Has been reported for
+			 * Mozilla JS with extremely long names. */
+			if (p_verbose >= 5)
+			{
+			    verbose_enter();
+			    MSG(_("Ignoring long line in tags file"));
+			    verbose_leave();
+			}
+			continue;
+		    }
+
+		    /* Corrupted tag line. */
 		    line_error = TRUE;
 		    break;
 		}
--- a/src/version.c
+++ b/src/version.c
@@ -715,6 +715,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    366,
+/**/
     365,
 /**/
     364,