summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/gui/skin_engine/skin_tokens.c5
-rw-r--r--manual/appendix/wps_tags.tex2
2 files changed, 5 insertions, 2 deletions
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c
index 29ddad4..1bb5b8e 100644
--- a/apps/gui/skin_engine/skin_tokens.c
+++ b/apps/gui/skin_engine/skin_tokens.c
@@ -927,7 +927,10 @@ const char *get_token_value(struct gui_wps *gwps,
if (utf8_len < ss->start)
return NULL;
- start_byte = utf8seek(token_val, ss->start);
+ if (ss->start < 0)
+ start_byte = utf8seek(token_val, ss->start + utf8_len);
+ else
+ start_byte = utf8seek(token_val, ss->start);
if (ss->length < 0 || (ss->start + ss->length) > utf8_len)
end_byte = strlen(token_val);
diff --git a/manual/appendix/wps_tags.tex b/manual/appendix/wps_tags.tex
index 4aa9472..51f10e9 100644
--- a/manual/appendix/wps_tags.tex
+++ b/manual/appendix/wps_tags.tex
@@ -766,7 +766,7 @@ a horizontal progressbar which doesn't fill and draws the image
\end{tagmap}
Use this tag to get a substring from another tag.
\begin{description}
- \item[start] -- first character to take (0 being the start of the string)
+ \item[start] -- first character to take (0 being the start of the string, negative means from the end of the string)
\item[length] -- length of the substring to return (- for the rest of the string)
\item[tag] -- tag to get
\item[number] -- OPTIONAL. if this is present it will assume the