summaryrefslogtreecommitdiffstats
path: root/apps/gui/skin_engine/skin_tokens.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2012-02-26 00:42:53 +1100
committerJonathan Gordon <rockbox@jdgordon.info>2012-02-26 00:50:14 +1100
commit31a05953e142b1ffff631cfb8b817880db7e4c27 (patch)
tree499dd370eb2b3b8fad4be38be2ca6bb03bcfdcc8 /apps/gui/skin_engine/skin_tokens.c
parent3cdd50bf41504d783b57502e685de481ac62e2f8 (diff)
downloadrockbox-31a05953e142b1ffff631cfb8b817880db7e4c27.tar.gz
rockbox-31a05953e142b1ffff631cfb8b817880db7e4c27.zip
FS#12586 - Modify %ss to be able to use numbers for conditionals
i.e %?ss(1,1,%cM)<|one|two|three|...|> or %xd(numbers, %ss(1,1%cM) Change-Id: I74ecb3f253f3be1fd270f75c0ef79addd364a7de
Diffstat (limited to 'apps/gui/skin_engine/skin_tokens.c')
-rw-r--r--apps/gui/skin_engine/skin_tokens.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c
index 82d96f6993..765102513a 100644
--- a/apps/gui/skin_engine/skin_tokens.c
+++ b/apps/gui/skin_engine/skin_tokens.c
@@ -942,6 +942,10 @@ const char *get_token_value(struct gui_wps *gwps,
buf = &buf[start_byte];
buf[byte_len] = '\0';
+ if (ss->expect_number &&
+ intval && (buf[0] >= '0' && buf[0] <= '9'))
+ *intval = atoi(buf) + 1; /* so 0 is the first item */
+
return buf;
}
return NULL;