From 28d41bb47413aa406c4c9f60044da646063a8966 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 14 Aug 2001 14:14:55 +0000 Subject: Fix the fix for #6722. * folder-browser.c (message_list_drag_data_get): Fix the fix for #6722. * mail-ops.c (save_messages_save): Likewise. (save_part_save): Deal with the possibility that camel_mime_filter_charset_new_convert will return NULL (bad charset name). Fixes #6611. svn path=/trunk/; revision=12008 --- mail/ChangeLog | 10 ++++++++++ mail/folder-browser.c | 2 +- mail/mail-ops.c | 8 +++++--- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index d30718d148..28eb0e73da 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,13 @@ +2001-08-14 Dan Winship + + * folder-browser.c (message_list_drag_data_get): Fix the fix for + #6722. + + * mail-ops.c (save_messages_save): Likewise. + (save_part_save): Deal with the possibility that + camel_mime_filter_charset_new_convert will return NULL (bad + charset name). Fixes #6611. + 2001-08-13 Jon Trowbridge * mail-search.c (mail_search_construct): Disable the "search diff --git a/mail/folder-browser.c b/mail/folder-browser.c index efa79fc179..348d0aa8d0 100644 --- a/mail/folder-browser.c +++ b/mail/folder-browser.c @@ -253,7 +253,7 @@ message_list_drag_data_get (ETree *tree, int row, ETreePath path, int col, uri_list = g_strdup_printf ("file://%s/%s", tmpdir, filename); - fd = open (uri_list + 7, O_WRONLY | O_CREAT); + fd = open (uri_list + 7, O_WRONLY | O_CREAT, 0666); if (fd == -1) { /* cleanup and abort */ camel_object_unref (CAMEL_OBJECT (message)); diff --git a/mail/mail-ops.c b/mail/mail-ops.c index f300a3359f..c21c207f29 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -1911,7 +1911,7 @@ save_messages_save (struct _mail_msg *mm) int fd, i; char *from; - fd = open (m->path, O_WRONLY | O_CREAT | O_TRUNC); + fd = open (m->path, O_WRONLY | O_CREAT | O_TRUNC, 0666); if (fd == -1) { camel_exception_setv(&mm->ex, CAMEL_EXCEPTION_SYSTEM, _("Unable to create output file: %s\n %s"), m->path, strerror(errno)); @@ -2048,8 +2048,10 @@ save_part_save (struct _mail_msg *mm) && g_strcasecmp (charset, "utf-8") != 0) { charsetfilter = camel_mime_filter_charset_new_convert ("utf-8", charset); filtered_stream = camel_stream_filter_new_with_stream (stream_fs); - camel_stream_filter_add (filtered_stream, CAMEL_MIME_FILTER (charsetfilter)); - camel_object_unref (CAMEL_OBJECT (charsetfilter)); + if (charsetfilter) { + camel_stream_filter_add (filtered_stream, CAMEL_MIME_FILTER (charsetfilter)); + camel_object_unref (CAMEL_OBJECT (charsetfilter)); + } } else { /* no we can't use a CAMEL_BLAH() cast here, since its not true, HOWEVER we only treat it as a normal stream from here on, so it is OK */ -- cgit v1.2.3