summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2015-05-05 14:26:56 +0200
committerTor Andersson <tor.andersson@artifex.com>2015-05-05 14:26:56 +0200
commit2d0479f860048b651b6e969af51b73898fe3f181 (patch)
tree49bb99473bc3164fc4689f0f006e9a90efad9391
parent8d308e8edd031c9a202ccdc20d67cf203f4769b9 (diff)
downloadmupdf-2d0479f860048b651b6e969af51b73898fe3f181.tar.xz
epub: Parse negative decimal numbers that start with the decimal point.
-rw-r--r--source/html/css-parse.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/html/css-parse.c b/source/html/css-parse.c
index adcd524b..f98287c0 100644
--- a/source/html/css-parse.c
+++ b/source/html/css-parse.c
@@ -377,6 +377,14 @@ restart:
css_lex_expect(buf, '>');
continue; /* ignore CDC */
}
+ if (css_lex_accept(buf, '.'))
+ {
+ css_push_char(buf, '-');
+ css_push_char(buf, '.');
+ if (buf->c >= '0' && buf->c <= '9')
+ return css_lex_number(buf);
+ return css_lex_keyword(buf);
+ }
if (buf->c >= '0' && buf->c <= '9')
{
css_push_char(buf, '-');
@@ -385,8 +393,6 @@ restart:
if (isnmstart(buf->c))
{
css_push_char(buf, '-');
- css_push_char(buf, buf->c);
- css_lex_next(buf);
return css_lex_keyword(buf);
}
return '-';