From 9318d1def60a193abae77e983a3f65b3cb87a9d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Sun, 22 Mar 2009 22:49:29 +0000 Subject: [PATCH] Fix wrong parsing of CSS tags when the definition block starts on a new line (reported by Dominic Hopf, thanks). git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3644 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 7 +++++++ tagmanager/css.c | 17 +++++------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index eb05aac83..8cbc891d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-03-22 Enrico Tröger + + * 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 * plugins/htmlchars.c: diff --git a/tagmanager/css.c b/tagmanager/css.c index 9b4003bbf..9ae2506db 100644 --- a/tagmanager/css.c +++ b/tagmanager/css.c @@ -73,23 +73,14 @@ static CssParserState parseCssDeclaration( const unsigned char **position, cssKi while ( isCssDeclarationAllowedChar(cp) || *cp == '\0' ) /* track the end of line into the loop */ { - if( (int) *cp == '\0' ) - { - cp = fileReadLine (); - if( cp == NULL ){ - makeCssSimpleTag(name, kind, TRUE); - *position = cp; - return P_STATE_AT_END; - } - } - else if( *cp == ',' ) + 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 @@ static CssParserState parseCssLine( const unsigned char *line, CssParserState st 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 == '\'' )