From 924bb95909e995b8cc5c8686580467e69234217b Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Thu, 11 Jun 2009 19:47:57 +0200 Subject: Correctly parse %time% if a format is provided --- libempathy-gtk/empathy-theme-adium.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'libempathy-gtk') 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++; } -- cgit v1.2.3