Blame SOURCES/ctags-CVE-2014-7204.patch

96f760
--- ctags/jscript.c.orig	2008-10-13 00:27:38.000000000 +0200
96f760
+++ ctags/jscript.c	2014-09-30 13:49:34.837349283 +0200
96f760
@@ -1,5 +1,5 @@
96f760
 /*
96f760
- *	 $Id: jscript.c 666 2008-05-15 17:47:31Z dfishburn $
96f760
+ *	 $Id: jscript.c 791 2012-10-24 01:13:13Z dfishburn $
96f760
  *
96f760
  *	 Copyright (c) 2003, Darren Hiebert
96f760
  *
96f760
@@ -215,6 +215,7 @@
96f760
  *	 Tag generation functions
96f760
  */
96f760
 
96f760
+/*
96f760
 static void makeConstTag (tokenInfo *const token, const jsKind kind)
96f760
 {
96f760
 	if (JsKinds [kind].enabled && ! token->ignoreTag )
96f760
@@ -238,12 +239,13 @@
96f760
 
96f760
 	if (JsKinds [kind].enabled && ! token->ignoreTag )
96f760
 	{
96f760
-		/*
96f760
+		*
96f760
 		 * If a scope has been added to the token, change the token
96f760
 		 * string to include the scope when making the tag.
96f760
-		 */
96f760
+		 *
96f760
 		if ( vStringLength(token->scope) > 0 )
96f760
 		{
96f760
+			*
96f760
 			fulltag = vStringNew ();
96f760
 			vStringCopy(fulltag, token->scope);
96f760
 			vStringCatS (fulltag, ".");
96f760
@@ -251,8 +253,54 @@
96f760
 			vStringTerminate(fulltag);
96f760
 			vStringCopy(token->string, fulltag);
96f760
 			vStringDelete (fulltag);
96f760
+			*
96f760
+ 			jsKind parent_kind = JSTAG_CLASS;
96f760
+ 
96f760
+ 			* 
96f760
+			 * if we're creating a function (and not a method),
96f760
+ 			 * guess we're inside another function 
96f760
+			 *
96f760
+ 			if (kind == JSTAG_FUNCTION)
96f760
+ 				parent_kind = JSTAG_FUNCTION;
96f760
+ 
96f760
+ 			e.extensionFields.scope[0] = JsKinds [parent_kind].name;
96f760
+ 			e.extensionFields.scope[1] = vStringValue (token->scope);
96f760
 		}
96f760
-		makeConstTag (token, kind);
96f760
+		* makeConstTag (token, kind); *
96f760
+ 		makeTagEntry (&e);
96f760
+	}
96f760
+}
96f760
+*/
96f760
+
96f760
+static void makeJsTag (tokenInfo *const token, const jsKind kind)
96f760
+{
96f760
+	if (JsKinds [kind].enabled && ! token->ignoreTag )
96f760
+	{
96f760
+		const char *const name = vStringValue (token->string);
96f760
+		tagEntryInfo e;
96f760
+		initTagEntry (&e, name);
96f760
+
96f760
+		e.lineNumber   = token->lineNumber;
96f760
+		e.filePosition = token->filePosition;
96f760
+		e.kindName	   = JsKinds [kind].name;
96f760
+		e.kind		   = JsKinds [kind].letter;
96f760
+
96f760
+		if ( vStringLength(token->scope) > 0 )
96f760
+		{
96f760
+			jsKind parent_kind = JSTAG_CLASS;
96f760
+
96f760
+			/* 
96f760
+			 * If we're creating a function (and not a method),
96f760
+			 * guess we're inside another function 
96f760
+			 */
96f760
+			if (kind == JSTAG_FUNCTION)
96f760
+				parent_kind = JSTAG_FUNCTION;
96f760
+
96f760
+			e.extensionFields.scope[0] = JsKinds [parent_kind].name;
96f760
+			e.extensionFields.scope[1] = vStringValue (token->scope);
96f760
+		}
96f760
+
96f760
+		makeTagEntry (&e);
96f760
 	}
96f760
 }
96f760