diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2015-05-05 14:26:56 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2015-05-05 14:26:56 +0200 |
commit | 2d0479f860048b651b6e969af51b73898fe3f181 (patch) | |
tree | 49bb99473bc3164fc4689f0f006e9a90efad9391 | |
parent | 8d308e8edd031c9a202ccdc20d67cf203f4769b9 (diff) | |
download | mupdf-2d0479f860048b651b6e969af51b73898fe3f181.tar.xz |
epub: Parse negative decimal numbers that start with the decimal point.
-rw-r--r-- | source/html/css-parse.c | 10 |
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 '-'; |