From 2dca8942c2ad00fefdd95133c2620f318ccde1b2 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 13 Nov 2014 12:03:28 +0100 Subject: html: Create value lists in the correct order. --- source/html/css-parse.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'source/html/css-parse.c') diff --git a/source/html/css-parse.c b/source/html/css-parse.c index 28176d14..fe91a933 100644 --- a/source/html/css-parse.c +++ b/source/html/css-parse.c @@ -408,19 +408,20 @@ static struct value *parse_value(struct lexbuf *buf) static struct value *parse_value_list(struct lexbuf *buf) { - struct value *v, *vv; + struct value *head, *tail; - vv = NULL; + head = tail = NULL; while (buf->lookahead != '}' && buf->lookahead != ';' && buf->lookahead != '!' && buf->lookahead != ')' && buf->lookahead != EOF) { - v = parse_value(buf); - v->next = vv; - vv = v; + if (!head) + head = tail = parse_value(buf); + else + tail = tail->next = parse_value(buf); } - return vv; + return head; } static struct property *parse_declaration(struct lexbuf *buf) -- cgit v1.2.3