]> diplodocus.org Git - nmh/blobdiff - uip/mhoutsbr.c
Apply David Levine's fix from whomfile() to sendfile() as well.
[nmh] / uip / mhoutsbr.c
index d3a0a85b656ae8da038bf66cd4723fe06ee0c6cd..1064b15e50739e7aa21788fc51668c4f35bb8455 100644 (file)
@@ -118,6 +118,11 @@ output_content (CT ct, FILE *out)
            putc ('\n', out);
 
        m = (struct multipart *) ct->c_ctparams;
+
+        if (m->mp_content_before) {
+           fprintf (out, "%s", m->mp_content_before);
+        }
+
        for (part = m->mp_parts; part; part = part->mp_next) {
            CT p = part->mp_part;
 
@@ -126,6 +131,10 @@ output_content (CT ct, FILE *out)
                return NOTOK;
        }
        fprintf (out, "\n--%s--\n", boundary);
+
+        if (m->mp_content_after) {
+           fprintf (out, "%s", m->mp_content_after);
+        }
     }
     break;
 
@@ -152,7 +161,14 @@ output_content (CT ct, FILE *out)
     default:
        switch (ct->c_encoding) {
        case CE_7BIT:
-           putc ('\n', out);
+           /* Special case:  if this is a non-MIME message with no
+              body, don't emit the newline that would appear between
+              the headers and body.  In that case, the call to
+              write8Bit() shouldn't be needed, but is harmless. */
+           if (ct->c_ctinfo.ci_attrs[0] != NULL  ||
+               ct->c_begin != ct->c_end) {
+               putc ('\n', out);
+           }
            result = write8Bit (ct, out);
            break;