From 5c81e944e63fd1f0e653832c23a798a23e8c07eb Mon Sep 17 00:00:00 2001 From: Punit Jain Date: Fri, 30 Sep 2011 11:54:54 +0530 Subject: Bug #656378 attachment name corruption --- calendar/gui/dialogs/comp-editor.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 27427540b6..9a60f6d382 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -3010,6 +3010,7 @@ attachment_loaded_cb (EAttachment *attachment, { GFileInfo *file_info; const gchar *display_name; + const gchar *new_name; const gchar *uid; /* Prior to 2.27.2, attachment files were named: @@ -3041,9 +3042,10 @@ attachment_loaded_cb (EAttachment *attachment, uid = g_object_get_data (G_OBJECT (attachment), "uid"); if (g_str_has_prefix (display_name, uid)) { - g_file_info_set_display_name ( - file_info, display_name + strlen (uid) + 1); + new_name = g_strdup (display_name+strlen(uid)+1); + g_file_info_set_display_name (file_info, new_name); g_object_notify (G_OBJECT (attachment), "file-info"); + g_free (new_name); } e_attachment_load_handle_error (attachment, result, parent); -- cgit v1.2.3