summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2008-11-27 01:46:54 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2008-11-27 01:46:54 +0000
commita572ac473682204ceab8e08be05c878569a8e5b0 (patch)
tree52090cfc9240abda502de69b6be83d6105fecb3d
parentd1ab23e5fffd2a458974b6a6b27b9adfd876496a (diff)
downloadlibcss-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.c6
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;