From 2d0479f860048b651b6e969af51b73898fe3f181 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 5 May 2015 14:26:56 +0200 Subject: epub: Parse negative decimal numbers that start with the decimal point. --- source/html/css-parse.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source/html/css-parse.c') 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 '-'; -- cgit v1.2.3