evolution-data-server r9456 - trunk/camel
- From: msuman svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution-data-server r9456 - trunk/camel
- Date: Mon, 1 Sep 2008 03:26:19 +0000 (UTC)
Author: msuman
Date: Mon Sep 1 03:26:19 2008
New Revision: 9456
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9456&view=rev
Log:
Patch from Keith Packard <keithp keithp com>: Fix for bug #541045 (Add a default mime-type to the mime-part if it doesn't have one).
Modified:
trunk/camel/ChangeLog
trunk/camel/camel-mime-part.c
Modified: trunk/camel/camel-mime-part.c
==============================================================================
--- trunk/camel/camel-mime-part.c (original)
+++ trunk/camel/camel-mime-part.c Mon Sep 1 03:26:19 2008
@@ -436,6 +436,7 @@
camel_mime_part_set_filename (CamelMimePart *mime_part, const char *filename)
{
char *str;
+ CamelDataWrapper *dw;
if (mime_part->disposition == NULL)
mime_part->disposition = camel_content_disposition_decode("attachment");
@@ -446,9 +447,12 @@
camel_medium_set_header (CAMEL_MEDIUM (mime_part),
"Content-Disposition", str);
g_free(str);
-
- camel_content_type_set_param (((CamelDataWrapper *) mime_part)->mime_type, "name", filename);
- str = camel_content_type_format (((CamelDataWrapper *) mime_part)->mime_type);
+
+ dw = (CamelDataWrapper *) mime_part;
+ if (!dw->mime_type)
+ dw->mime_type = camel_content_type_new ("application", "octet-stream");
+ camel_content_type_set_param (dw->mime_type, "name", filename);
+ str = camel_content_type_format (dw->mime_type);
camel_medium_set_header (CAMEL_MEDIUM (mime_part), "Content-Type", str);
g_free (str);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]