From 4c94b98422b7a0e0ef1eb93eac2f3abd7fdfa9b8 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Thu, 5 Jul 2012 22:41:10 +1000 Subject: [PATCH] skin_engine: Fix a obscure parser bug Tag params where a [] group is followed (but not immediatly) by a * will not parse correctly. e.g [si]iii|s* will attempt to find an 'i' after the second s instead of looping s's Change-Id: I3982f726b6539818f8332334b263b673259f98ef --- lib/skin_parser/skin_parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/skin_parser/skin_parser.c b/lib/skin_parser/skin_parser.c index 44a1c03245..748ea5da22 100644 --- a/lib/skin_parser/skin_parser.c +++ b/lib/skin_parser/skin_parser.c @@ -617,7 +617,7 @@ static int skin_parse_tag(struct skin_element* element, const char** document) /* Checking for comments */ if(*cursor == COMMENTSYM) skip_comment(&cursor); - + if (*tag_args == '[') { /* we need to guess which type of param it is. @@ -782,7 +782,7 @@ static int skin_parse_tag(struct skin_element* element, const char** document) { if (i+1 == num_args) tag_args += 2; - else if (open_square_bracket) + else if (open_square_bracket && *tag_args == ']') { tag_args = open_square_bracket; open_square_bracket = NULL;