summaryrefslogtreecommitdiff
path: root/src/parse/mq.c
diff options
context:
space:
mode:
authorJohn-Mark Bell <jmb@netsurf-browser.org>2019-02-18 00:44:40 +0000
committerMichael Drake <michael.drake@codethink.co.uk>2019-03-10 13:42:03 +0000
commit965117e95ba32a4261b1eeaa1fd9a70f541e7e1b (patch)
tree24f485655ba1fe52624022320a4ee88e838c0804 /src/parse/mq.c
parent06278f34e47a257a1c8cc2a1ca053c330b1e34d5 (diff)
downloadlibcss-965117e95ba32a4261b1eeaa1fd9a70f541e7e1b.tar.gz
libcss-965117e95ba32a4261b1eeaa1fd9a70f541e7e1b.tar.bz2
Media Queries: fix parsing of media-condition
Diffstat (limited to 'src/parse/mq.c')
-rw-r--r--src/parse/mq.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/parse/mq.c b/src/parse/mq.c
index 2b2164f..9d232f9 100644
--- a/src/parse/mq.c
+++ b/src/parse/mq.c
@@ -686,7 +686,7 @@ static css_error mq_parse_condition(lwc_string **strings,
bool permit_or, css_mq_cond **cond)
{
const css_token *token;
- bool match;
+ bool match = false;
int op = 0; /* Will be AND | OR once we've had one */
css_mq_cond_or_feature *cond_or_feature, **parts;
css_mq_cond *result;
@@ -700,11 +700,12 @@ static css_error mq_parse_condition(lwc_string **strings,
*/
token = parserutils_vector_peek(vector, *ctx);
- if (token == NULL || tokenIsChar(token, '(') == false ||
- token->type != CSS_TOKEN_IDENT ||
+ if (token == NULL ||
+ (tokenIsChar(token, '(') == false &&
+ token->type != CSS_TOKEN_IDENT &&
lwc_string_caseless_isequal(token->idata,
- strings[NOT], &match) != lwc_error_ok ||
- match == false) {
+ strings[NOT], &match) != lwc_error_ok &&
+ match == false)) {
return CSS_INVALID;
}