summaryrefslogtreecommitdiff
path: root/source/html/css-parse.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2014-11-14 10:52:55 +0100
committerTor Andersson <tor.andersson@artifex.com>2014-12-03 12:25:51 +0100
commit5ba0b431a80707230c0e7e14c2b4eb520efb3e2d (patch)
treef6471271d66a686ba22ab0293757b67f97e14cfb /source/html/css-parse.c
parent95b7dff5c86a8a9c09c8771a15ea7963044597ef (diff)
downloadmupdf-5ba0b431a80707230c0e7e14c2b4eb520efb3e2d.tar.xz
html: Fix CSS parsing mixed-case selectors and comments.
Diffstat (limited to 'source/html/css-parse.c')
-rw-r--r--source/html/css-parse.c7
1 files changed, 4 insertions, 3 deletions
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);
}