summaryrefslogtreecommitdiffstats
path: root/lib/skin_parser
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2011-09-25 07:43:36 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2011-09-25 07:43:36 +0000
commitd7372533d07c3168715f9efdace76da1d3983fee (patch)
tree65cdb81ca8c7607dc3ec8323723dee71ed511263 /lib/skin_parser
parent40f05b6ca1709d91dfcd120c7758b36af1cce06b (diff)
downloadrockbox-d7372533d07c3168715f9efdace76da1d3983fee.tar.gz
rockbox-d7372533d07c3168715f9efdace76da1d3983fee.tar.bz2
rockbox-d7372533d07c3168715f9efdace76da1d3983fee.zip
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
Diffstat (limited to 'lib/skin_parser')
-rw-r--r--lib/skin_parser/skin_parser.c26
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)
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;