]> git.0d.be Git - empathy.git/commitdiff
Correctly parse %time% if a format is provided
authorXavier Claessens <xclaesse@gmail.com>
Thu, 11 Jun 2009 17:47:57 +0000 (19:47 +0200)
committerXavier Claessens <xclaesse@gmail.com>
Thu, 11 Jun 2009 17:47:57 +0000 (19:47 +0200)
libempathy-gtk/empathy-theme-adium.c

index c838800c11b457fe2bb42da75bd9f203b7f2067f..74d5591b6a565da7104e8322a2917ee710a56822 100644 (file)
@@ -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++;
                        }