From 82071abd45b2dbc7874c3556fbc03a503cf29bd3 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Wed, 26 Apr 2000 21:50:34 +0000 Subject: Only write a newline between the headers and the content object if the * camel-mime-part.c (write_to_stream): Only write a newline between the headers and the content object if the content object is not a CamelMedium. (If the content is a medium, it may have its own headers, which then need to go before the blank line.) svn path=/trunk/; revision=2647 --- camel/ChangeLog | 5 +++++ camel/camel-mime-part.c | 11 +++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/camel/ChangeLog b/camel/ChangeLog index ec90e10de8..0bea69df22 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,5 +1,10 @@ 2000-04-26 Dan Winship + * camel-mime-part.c (write_to_stream): Only write a newline + between the headers and the content object if the content object + is not a CamelMedium. (If the content is a medium, it may have its + own headers, which then need to go before the blank line.) + * camel-mime-body-part.[ch]: Remove. We weren't using the fields that made this different from camel-mime-part, so it basically just forced us to do lots of gratuitous typecasting. diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c index 6e2276df90..30c08a485f 100644 --- a/camel/camel-mime-part.c +++ b/camel/camel-mime-part.c @@ -504,11 +504,14 @@ write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream) } } - if ( (count = camel_stream_write_string(stream,"\n")) == -1) - return -1; - total += count; - content = camel_medium_get_content_object (medium); + + if (!CAMEL_IS_MEDIUM (content)) { + if ( (count = camel_stream_write_string(stream,"\n")) == -1) + return -1; + total += count; + } + if (content) { if ( (count = camel_data_wrapper_write_to_stream(content, stream)) == -1 ) return -1; -- cgit v1.2.3