Partial fix for FS#12289 - comment lines would waste lots of buffer space. Still not perfect but should get 90+% of comments completly ignored now.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30596 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2011-09-25 07:43:36 +00:00
parent 40f05b6ca1
commit d7372533d0

View file

@ -93,7 +93,6 @@ struct skin_element* skin_parse(const char* document)
while(*cursor != '\0')
{
if(!root)
to_write = &root;
else
@ -227,7 +226,17 @@ static struct skin_element* skin_parse_viewport(const char** document)
}
else
{
#ifdef ROCKBOX
/* strip all leading comments */
while(*cursor == '#')
{
skip_comment(&cursor);
skin_line++;
}
if (check_viewport(cursor))
break;
#endif
*to_write = skin_parse_line(&cursor);
last = *to_write;
if(!last)
@ -243,6 +252,18 @@ static struct skin_element* skin_parse_viewport(const char** document)
cursor++;
skin_line++;
}
#ifdef ROCKBOX
/* strip all comments */
while(*cursor == '#')
{
skip_comment(&cursor);
skin_line++;
}
if (check_viewport(cursor))
break;
#endif
}
while(*cursor != '\0' && !(check_viewport(cursor) && cursor != *document));
@ -359,7 +380,6 @@ static struct skin_element* skin_parse_line_optional(const char** document,
}
}
/* Moving up the calling function's pointer */
*document = cursor;