SF.net SVN: geany:[3644] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Sun Mar 22 22:49:30 UTC 2009


Revision: 3644
          http://geany.svn.sourceforge.net/geany/?rev=3644&view=rev
Author:   eht16
Date:     2009-03-22 22:49:29 +0000 (Sun, 22 Mar 2009)

Log Message:
-----------
Fix wrong parsing of CSS tags when the definition block starts on a new line (reported by Dominic Hopf, thanks).

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/tagmanager/css.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2009-03-20 17:22:18 UTC (rev 3643)
+++ trunk/ChangeLog	2009-03-22 22:49:29 UTC (rev 3644)
@@ -1,3 +1,10 @@
+2009-03-22  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>
+
+ * tagmanager/css.c:
+   Fix wrong parsing of CSS tags when the definition block starts on
+   a new line (reported by Dominic Hopf, thanks).
+
+
 2009-03-20  Frank Lanitz  <frank(at)frank(dot)uvena(dot)de>
 
  * plugins/htmlchars.c:

Modified: trunk/tagmanager/css.c
===================================================================
--- trunk/tagmanager/css.c	2009-03-20 17:22:18 UTC (rev 3643)
+++ trunk/tagmanager/css.c	2009-03-22 22:49:29 UTC (rev 3644)
@@ -73,23 +73,14 @@
 	while ( isCssDeclarationAllowedChar(cp) ||
 			*cp == '\0' ) 	/* track the end of line into the loop */
 	{
-		if( (int) *cp == '\0' )
+		if( *cp == ',' )
 		{
-			cp = fileReadLine ();
-			if( cp == NULL ){
-				makeCssSimpleTag(name, kind, TRUE);
-				*position = cp;
-				return P_STATE_AT_END;
-			}
-		}
-		else if( *cp == ',' )
-		{
 			makeCssSimpleTag(name, kind, TRUE);
 			*position = cp;
 			return P_STATE_NONE;
 		}
-		else if( *cp == '{' )
-		{
+		else if( *cp == '{' || *cp == '\0' )
+		{ /* assume that line end is the same as a starting definition (i.e. the { is on the next line */
 			makeCssSimpleTag(name, kind, TRUE);
 			*position = cp;
 			return P_STATE_IN_DEFINITION;
@@ -197,6 +188,8 @@
 			case P_STATE_IN_PAGE:
 			case P_STATE_IN_FONTFACE:
 			case P_STATE_IN_DEFINITION:
+				if( *line == '\0' )
+					line = fileReadLine ();
 				if( *line == '}' )
 					state = P_STATE_NONE;
 				else if( *line == '\'' )


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list