diff options
author | Magnus Holmgren <magnushol@gmail.com> | 2010-08-15 07:08:23 +0000 |
---|---|---|
committer | Magnus Holmgren <magnushol@gmail.com> | 2010-08-15 07:08:23 +0000 |
commit | ac2c69ccae5db7d5e22acf976910cdf3be84fe5a (patch) | |
tree | 55ca852431d91fe3a6c8e6ac9f3c8e8dc15802f0 /apps/gui/skin_engine/skin_parser.c | |
parent | b413169b2ef5d94b2574afe0122c476ad703f4ff (diff) | |
download | rockbox-ac2c69ccae5db7d5e22acf976910cdf3be84fe5a.tar.gz rockbox-ac2c69ccae5db7d5e22acf976910cdf3be84fe5a.zip |
Allow 'long' labels with single-argument %xd too. The label need to be at least 3 chars long (2 chars are treated as a single-letter-label image with a subimage).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27820 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/skin_engine/skin_parser.c')
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index 8fca8724f6..68cb01470c 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c | |||
@@ -228,14 +228,15 @@ static int parse_image_display(struct skin_element *element, | |||
228 | struct wps_data *wps_data) | 228 | struct wps_data *wps_data) |
229 | { | 229 | { |
230 | char *label = element->params[0].data.text; | 230 | char *label = element->params[0].data.text; |
231 | char sublabel = label[1]; | 231 | char sublabel = '\0'; |
232 | int subimage; | 232 | int subimage; |
233 | struct gui_img *img; | 233 | struct gui_img *img; |
234 | struct image_display *id = skin_buffer_alloc(sizeof(struct image_display)); | 234 | struct image_display *id = skin_buffer_alloc(sizeof(struct image_display)); |
235 | 235 | ||
236 | if (element->params_count == 1) | 236 | if (element->params_count == 1 && strlen(label) <= 2) |
237 | { | 237 | { |
238 | /* backwards compatability. Allow %xd(Aa) to still work */ | 238 | /* backwards compatability. Allow %xd(Aa) to still work */ |
239 | sublabel = label[1]; | ||
239 | label[1] = '\0'; | 240 | label[1] = '\0'; |
240 | } | 241 | } |
241 | /* sanity check */ | 242 | /* sanity check */ |