From a572ac473682204ceab8e08be05c878569a8e5b0 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Thu, 27 Nov 2008 01:46:54 +0000 Subject: 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 --- src/parse/parse.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3