aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2009-06-12 01:47:57 +0800
committerXavier Claessens <xclaesse@gmail.com>2009-06-12 01:47:57 +0800
commit924bb95909e995b8cc5c8686580467e69234217b (patch)
tree0923a71b52bdcb820256b96a80dd19bbd2112155
parent6cad3e6d0d4123a7eaf8fbb8dc6cf1976854aaa4 (diff)
downloadgsoc2013-empathy-924bb95909e995b8cc5c8686580467e69234217b.tar
gsoc2013-empathy-924bb95909e995b8cc5c8686580467e69234217b.tar.gz
gsoc2013-empathy-924bb95909e995b8cc5c8686580467e69234217b.tar.bz2
gsoc2013-empathy-924bb95909e995b8cc5c8686580467e69234217b.tar.lz
gsoc2013-empathy-924bb95909e995b8cc5c8686580467e69234217b.tar.xz
gsoc2013-empathy-924bb95909e995b8cc5c8686580467e69234217b.tar.zst
gsoc2013-empathy-924bb95909e995b8cc5c8686580467e69234217b.zip
Correctly parse %time% if a format is provided
-rw-r--r--libempathy-gtk/empathy-theme-adium.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c
index c838800c1..74d5591b6 100644
--- a/libempathy-gtk/empathy-theme-adium.c
+++ b/libempathy-gtk/empathy-theme-adium.c
@@ -405,16 +405,18 @@ theme_adium_append_html (EmpathyThemeAdium *theme,
gchar *format = NULL;
gchar *end;
- /* Extract the time format if provided. */
- if (*cur == '{') {
- end = strstr (cur + 1, "}%");
+ /* Time can be in 2 formats:
+ * %time% or %time{strftime format}%
+ * Extract the time format if provided. */
+ if (cur[1] == '{') {
+ cur += 2;
+ end = strstr (cur, "}%");
if (!end) {
/* Invalid string */
continue;
}
- cur++;
format = g_strndup (cur, end - cur);
- cur = end;
+ cur = end + 1;
} else {
cur++;
}