[evolution-data-server] I#372 - CamelMultipart: Writes unnecessary empty line after top headers



commit 7bfd26331031c04bf6999044bac7e50a36b50781
Author: Milan Crha <mcrha redhat com>
Date:   Mon Jan 24 09:42:35 2022 +0100

    I#372 - CamelMultipart: Writes unnecessary empty line after top headers
    
    Closes https://gitlab.gnome.org/GNOME/evolution-data-server/-/issues/372

 src/camel/camel-multipart.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/camel/camel-multipart.c b/src/camel/camel-multipart.c
index ae60d31c3..288d600f0 100644
--- a/src/camel/camel-multipart.c
+++ b/src/camel/camel-multipart.c
@@ -133,7 +133,7 @@ multipart_write_to_stream_sync (CamelDataWrapper *data_wrapper,
 
                part = g_ptr_array_index (priv->parts, ii);
 
-               content = g_strdup_printf ("\n--%s\n", boundary);
+               content = g_strdup_printf ("%s--%s\n", ii > 0  || priv->preface ? "\n" : "", boundary);
                count = camel_stream_write_string (
                        stream, content, cancellable, error);
                g_free (content);
@@ -218,7 +218,7 @@ multipart_write_to_output_stream_sync (CamelDataWrapper *data_wrapper,
 
                part = g_ptr_array_index (priv->parts, ii);
 
-               content = g_strdup_printf ("\n--%s\n", boundary);
+               content = g_strdup_printf ("%s--%s\n", ii > 0  || priv->preface ? "\n" : "", boundary);
                success = g_output_stream_write_all (
                        output_stream,
                        content, strlen (content),


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