[empathy] Correctly parse %time% if a format is provided



commit 924bb95909e995b8cc5c8686580467e69234217b
Author: Xavier Claessens <xclaesse gmail com>
Date:   Thu Jun 11 19:47:57 2009 +0200

    Correctly parse %time% if a format is provided

 libempathy-gtk/empathy-theme-adium.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c
index c838800..74d5591 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++;
 			}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]