From 5ba0b431a80707230c0e7e14c2b4eb520efb3e2d Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 14 Nov 2014 10:52:55 +0100 Subject: html: Fix CSS parsing mixed-case selectors and comments. --- source/html/css-parse.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source/html') diff --git a/source/html/css-parse.c b/source/html/css-parse.c index 93c5ff58..63abee42 100644 --- a/source/html/css-parse.c +++ b/source/html/css-parse.c @@ -35,13 +35,13 @@ static int iswhite(int c) static int isnmstart(int c) { - return c == '\\' || c == '_' || (c >= 'a' && c <= 'z') || + return c == '\\' || c == '_' || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= 128 && c <= 255); } static int isnmchar(int c) { - return c == '\\' || c == '_' || (c >= 'a' && c <= 'z') || + return c == '\\' || c == '_' || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '-' || (c >= 128 && c <= 255); } @@ -196,6 +196,7 @@ static int css_lex(struct lexbuf *buf) while (buf->c) { +restart: while (iswhite(buf->c)) css_lex_next(buf); @@ -213,7 +214,7 @@ static int css_lex(struct lexbuf *buf) while (buf->c == '*') css_lex_next(buf); if (css_lex_accept(buf, '/')) - continue; + goto restart; } css_lex_next(buf); } -- cgit v1.2.3