[evolution] Bug #656378 attachment name corruption



commit 5c81e944e63fd1f0e653832c23a798a23e8c07eb
Author: Punit Jain <jpunit novell com>
Date:   Fri Sep 30 11:54:54 2011 +0530

    Bug #656378 attachment name corruption

 calendar/gui/dialogs/comp-editor.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index 2742754..9a60f6d 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);



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