summaryrefslogtreecommitdiffstats
path: root/apps/gui/skin_engine/skin_tokens.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/skin_engine/skin_tokens.c')
-rw-r--r--apps/gui/skin_engine/skin_tokens.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c
index ed72241d34..371db46017 100644
--- a/apps/gui/skin_engine/skin_tokens.c
+++ b/apps/gui/skin_engine/skin_tokens.c
@@ -868,7 +868,34 @@ const char *get_token_value(struct gui_wps *gwps,
struct logical_if *lif = token->value.data;
return get_lif_token_value(gwps, lif, offset, buf, buf_size);
}
- break;
+ break;
+ case SKIN_TOKEN_SUBSTRING:
+ {
+ struct substring *ss = token->value.data;
+ const char *token_val = get_token_value(gwps, ss->token, offset,
+ buf, buf_size, intval);
+ int ret_len = ss->length;
+ if (token_val)
+ {
+ int len = strlen(token_val);
+ if (len < ss->start)
+ return NULL;
+ if (ret_len < 0)
+ ret_len = strlen(token_val) - ss->start;
+ if (token_val != buf)
+ {
+ memcpy(buf, &token_val[ss->start], ret_len);
+ }
+ else
+ {
+ buf = &buf[ss->start];
+ }
+ buf[ret_len] = '\0';
+ return buf;
+ }
+ return NULL;
+ }
+ break;
case SKIN_TOKEN_CHARACTER:
if (token->value.c == '\n')