diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2008-11-27 01:46:54 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2008-11-27 01:46:54 +0000 |
commit | a572ac473682204ceab8e08be05c878569a8e5b0 (patch) | |
tree | 52090cfc9240abda502de69b6be83d6105fecb3d | |
parent | d1ab23e5fffd2a458974b6a6b27b9adfd876496a (diff) | |
download | libcss-a572ac473682204ceab8e08be05c878569a8e5b0.tar.gz libcss-a572ac473682204ceab8e08be05c878569a8e5b0.tar.bz2 |
Don't intern strings for CSS_TOKEN_S tokens. This is pointless, as all we care about is the token type in this case.
svn path=/trunk/libcss/; revision=5806
-rw-r--r-- | src/parse/parse.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/parse/parse.c b/src/parse/parse.c index 3976c0c..f12ffe5 100644 --- a/src/parse/parse.c +++ b/src/parse/parse.c @@ -579,7 +579,8 @@ css_error getToken(css_parser *parser, const css_token **token) if (error != CSS_OK) return error; - if (t->data.ptr != NULL && t->data.len > 0) { + if (t->type != CSS_TOKEN_S && + t->data.ptr != NULL && t->data.len > 0) { /* Insert token text into the dictionary */ const parserutils_dict_entry *interned; uint8_t temp[t->data.len]; @@ -635,6 +636,9 @@ css_error getToken(css_parser *parser, const css_token **token) t->data.ptr = interned->data; t->data.len = interned->len; + } else if (t->type == CSS_TOKEN_S) { + t->data.ptr = t->lower.ptr = NULL; + t->data.len = t->lower.len = 0; } *token = t; |