Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37531384
en ru br
Репозитории ALT
S:5.8-alt6
5.1: 5.6-alt1
4.1: 5.6-alt1
4.0: 5.6-alt1
3.0: 5.5.4-alt1
www.altlinux.org/Changes

Группа :: Разработка/Прочее
Пакет: ctags

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: ctags-5.8-r791-cve-2014-7204-fix.patch
Скачать


--- a/jscript.c
+++ b/jscript.c
@@ -215,6 +215,7 @@
  *	 Tag generation functions
  */
 
+/*
 static void makeConstTag (tokenInfo *const token, const jsKind kind)
 {
 	if (JsKinds [kind].enabled && ! token->ignoreTag )
@@ -238,12 +239,13 @@
 
 	if (JsKinds [kind].enabled && ! token->ignoreTag )
 	{
-		/*
+		*
 		 * If a scope has been added to the token, change the token
 		 * string to include the scope when making the tag.
-		 */
+		 *
 		if ( vStringLength(token->scope) > 0 )
 		{
+			*
 			fulltag = vStringNew ();
 			vStringCopy(fulltag, token->scope);
 			vStringCatS (fulltag, ".");
@@ -251,9 +253,55 @@
 			vStringTerminate(fulltag);
 			vStringCopy(token->string, fulltag);
 			vStringDelete (fulltag);
-		}
-		makeConstTag (token, kind);
+			*
+ 			jsKind parent_kind = JSTAG_CLASS;
+ 
+ 			* 
+			 * if we're creating a function (and not a method),
+ 			 * guess we're inside another function 
+			 *
+ 			if (kind == JSTAG_FUNCTION)
+ 				parent_kind = JSTAG_FUNCTION;
+ 
+ 			e.extensionFields.scope[0] = JsKinds [parent_kind].name;
+ 			e.extensionFields.scope[1] = vStringValue (token->scope);
+		}
+		* makeConstTag (token, kind); *
+ 		makeTagEntry (&e);
+	}
+}
+*/
+
+static void makeJsTag (tokenInfo *const token, const jsKind kind)
+{
+	if (JsKinds [kind].enabled && ! token->ignoreTag )
+	{
+		const char *const name = vStringValue (token->string);
+		tagEntryInfo e;
+		initTagEntry (&e, name);
+
+		e.lineNumber   = token->lineNumber;
+		e.filePosition = token->filePosition;
+		e.kindName	   = JsKinds [kind].name;
+		e.kind		   = JsKinds [kind].letter;
+
+		if ( vStringLength(token->scope) > 0 )
+		{
+			jsKind parent_kind = JSTAG_CLASS;
+
+			/* 
+			 * If we're creating a function (and not a method),
+			 * guess we're inside another function 
+			 */
+			if (kind == JSTAG_FUNCTION)
+				parent_kind = JSTAG_FUNCTION;
+
+			e.extensionFields.scope[0] = JsKinds [parent_kind].name;
+			e.extensionFields.scope[1] = vStringValue (token->scope);
+		}
+
+		makeTagEntry (&e);
 	}
 }
 
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin