commit 63bd568bc9714a84b83cf6d8d454c04d1dec3761
Author: Xavier Claessens <xclaesse@gmail.com>
Date:   Sun Nov 1 14:28:07 2009 +0100

    Cleanup in the butterfly workaround

diff --git a/libempathy/empathy-log-store-pidgin.c b/libempathy/empathy-log-store-pidgin.c
index 0c653c7..7e91c1a 100644
--- a/libempathy/empathy-log-store-pidgin.c
+++ b/libempathy/empathy-log-store-pidgin.c
@@ -92,7 +92,7 @@ log_store_pidgin_get_dir (EmpathyLogStore *self,
   gchar *basedir;
   EmpathyLogStorePidginPriv *priv;
   gchar *username, *normalized, *tmp;
-  gchar *id, *dup = NULL;
+  gchar *dup_id = NULL;
   const GHashTable *params;
   GString *acc;
   gunichar c;
@@ -124,14 +124,13 @@ log_store_pidgin_get_dir (EmpathyLogStore *self,
     }
 
   /* Small butterfly workaround */
-  id = (gchar *) chat_id;
   if (chat_id != NULL && g_str_has_suffix (chat_id, "#1"))
-    id = dup = g_strndup (chat_id, (strlen (chat_id) - 2));
+    chat_id = dup_id = g_strndup (chat_id, strlen (chat_id) - 2);
 
   if (chatroom)
     {
-      g_free (dup);
-      id = dup =g_strdup_printf ("%s.chat", id);
+      g_free (dup_id);
+      chat_id = dup_id =g_strdup_printf ("%s.chat", chat_id);
     }
 
   normalized = g_utf8_normalize (username, -1, G_NORMALIZE_DEFAULT);
@@ -165,9 +164,9 @@ log_store_pidgin_get_dir (EmpathyLogStore *self,
   normalized = g_string_free (acc, FALSE);
 
   basedir = g_build_path (G_DIR_SEPARATOR_S, priv->basedir, protocol,
-      normalized, id, NULL);
+      normalized, chat_id, NULL);
 
-  g_free (dup);
+  g_free (dup_id);
   g_free (normalized);
 
   return basedir;
