diff options
Diffstat (limited to 'lib/skin_parser/skin_parser.c')
-rw-r--r-- | lib/skin_parser/skin_parser.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/lib/skin_parser/skin_parser.c b/lib/skin_parser/skin_parser.c index c4bd78c8ee..7408252949 100644 --- a/lib/skin_parser/skin_parser.c +++ b/lib/skin_parser/skin_parser.c | |||
@@ -93,7 +93,6 @@ struct skin_element* skin_parse(const char* document) | |||
93 | 93 | ||
94 | while(*cursor != '\0') | 94 | while(*cursor != '\0') |
95 | { | 95 | { |
96 | |||
97 | if(!root) | 96 | if(!root) |
98 | to_write = &root; | 97 | to_write = &root; |
99 | else | 98 | else |
@@ -227,7 +226,17 @@ static struct skin_element* skin_parse_viewport(const char** document) | |||
227 | } | 226 | } |
228 | else | 227 | else |
229 | { | 228 | { |
230 | 229 | #ifdef ROCKBOX | |
230 | /* strip all leading comments */ | ||
231 | while(*cursor == '#') | ||
232 | { | ||
233 | skip_comment(&cursor); | ||
234 | skin_line++; | ||
235 | |||
236 | } | ||
237 | if (check_viewport(cursor)) | ||
238 | break; | ||
239 | #endif | ||
231 | *to_write = skin_parse_line(&cursor); | 240 | *to_write = skin_parse_line(&cursor); |
232 | last = *to_write; | 241 | last = *to_write; |
233 | if(!last) | 242 | if(!last) |
@@ -243,6 +252,18 @@ static struct skin_element* skin_parse_viewport(const char** document) | |||
243 | cursor++; | 252 | cursor++; |
244 | skin_line++; | 253 | skin_line++; |
245 | } | 254 | } |
255 | #ifdef ROCKBOX | ||
256 | /* strip all comments */ | ||
257 | while(*cursor == '#') | ||
258 | { | ||
259 | skip_comment(&cursor); | ||
260 | skin_line++; | ||
261 | |||
262 | } | ||
263 | if (check_viewport(cursor)) | ||
264 | break; | ||
265 | #endif | ||
266 | |||
246 | } | 267 | } |
247 | while(*cursor != '\0' && !(check_viewport(cursor) && cursor != *document)); | 268 | while(*cursor != '\0' && !(check_viewport(cursor) && cursor != *document)); |
248 | 269 | ||
@@ -359,7 +380,6 @@ static struct skin_element* skin_parse_line_optional(const char** document, | |||
359 | } | 380 | } |
360 | } | 381 | } |
361 | 382 | ||
362 | |||
363 | /* Moving up the calling function's pointer */ | 383 | /* Moving up the calling function's pointer */ |
364 | *document = cursor; | 384 | *document = cursor; |
365 | 385 | ||