diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-01-29 11:56:01 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-01-29 11:56:01 +0000 |
commit | dc74baf9e938243962617313464e3a24805fcb2c (patch) | |
tree | 213d332d893bd1c9289a3c577aa7140bdeb8b54e /src/libserver/css/css_tokeniser.cxx | |
parent | 67857e64c268fe2dc04e425c74e37c4859edfd58 (diff) | |
download | rspamd-dc74baf9e938243962617313464e3a24805fcb2c.tar.gz rspamd-dc74baf9e938243962617313464e3a24805fcb2c.zip |
[Project] Css: Several fixes + tests
Diffstat (limited to 'src/libserver/css/css_tokeniser.cxx')
-rw-r--r-- | src/libserver/css/css_tokeniser.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/libserver/css/css_tokeniser.cxx b/src/libserver/css/css_tokeniser.cxx index 60ff297b3..71304a4d1 100644 --- a/src/libserver/css/css_tokeniser.cxx +++ b/src/libserver/css/css_tokeniser.cxx @@ -308,7 +308,6 @@ auto css_tokeniser::consume_ident() -> struct css_parser_token } } else { - i --; /* Push token back */ break; /* Not an ident token */ } } /* !plain ident */ @@ -341,7 +340,6 @@ auto css_tokeniser::consume_number() -> struct css_parser_token seen_dot = true; } else { - i --; /* Push back */ break; } } @@ -358,10 +356,12 @@ auto css_tokeniser::consume_number() -> struct css_parser_token } } else { - i --; /* Push back */ break; } } + else { + break; + } } i ++; @@ -400,6 +400,10 @@ auto css_tokeniser::consume_number() -> struct css_parser_token offset = i; } } + else { + /* Plain number */ + offset = i; + } } else { offset = i; @@ -564,8 +568,10 @@ auto css_tokeniser::next_token(void) -> struct css_parser_token offset = i + 1; return make_token<css_parser_token::token_type::ecurlbrace_token>(); case ',': + offset = i + 1; return make_token<css_parser_token::token_type::comma_token>(); case ';': + offset = i + 1; return make_token<css_parser_token::token_type::semicolon_token>(); case '<': /* Maybe an xml like comment */ |