]> diplodocus.org Git - nmh/commitdiff
Fix to commit 84932d0a96c79bfb2f0384ebab806dc51a35f600 to
authorDavid Levine <levinedl@acm.org>
Sun, 10 Apr 2016 15:16:55 +0000 (11:16 -0400)
committerDavid Levine <david.levine@gonift.com>
Sun, 10 Apr 2016 15:23:03 +0000 (11:23 -0400)
insert blank line between header and content for non-text
content.

(cherry picked from commit fe36a7ee2f4304fd3797443d4f2f950d6dc2475d)

test/mhbuild/test-attach
uip/mhoutsbr.c

index 3e20158a495b3129ea9da324af5e317801158c9a..3b285ef695e7c4a1ad3414abb8acc44d8e2a118d 100755 (executable)
@@ -360,6 +360,50 @@ EOF
 
 check "$draft" "$expected"
 
 
 check "$draft" "$expected"
 
+# check that blank line is inserted between header and content
+
+cat > "$MH_TEST_DIR/Mail/oneline" <<EOF
+There needs to be a blank line before this content line.
+EOF
+
+cat > "$draft" <<EOF
+To: Mr Test <mrtest@example.com>
+cc:
+Fcc: +outbox
+Subject: test blank line between header and content
+--------
+#text/plain {inline} $MH_TEST_DIR/Mail/oneline
+#application/octet-stream {inline} $MH_TEST_DIR/Mail/oneline
+EOF
+
+run_prog mhbuild "$draft"
+
+cat > "$expected" <<EOF
+To: Mr Test <mrtest@example.com>
+cc:
+Fcc: +outbox
+Subject: test blank line between header and content
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
+
+------- =_aaaaaaaaaa0
+Content-Type: text/plain; charset="us-ascii"
+Content-Disposition: inline; filename="oneline"
+
+There needs to be a blank line before this content line.
+
+------- =_aaaaaaaaaa0
+Content-Type: application/octet-stream
+Content-Disposition: inline; filename="oneline"
+
+There needs to be a blank line before this content line.
+
+------- =_aaaaaaaaaa0--
+EOF
+
+check "$draft" "$expected"
+
+
 [ ${failed:=0} -eq 0 ]  &&  rm -f ${backup}
 
 exit ${failed:-0}
 [ ${failed:=0} -eq 0 ]  &&  rm -f ${backup}
 
 exit ${failed:-0}
index 456a2e279fdff726e039f243620598dac34d1d92..0f3e9c1dfaa2badc66bc05b3f11f6a719baef2d3 100644 (file)
@@ -164,7 +164,7 @@ output_content (CT ct, FILE *out)
               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. */
               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_first_pm != NULL  ||
+           if (ct->c_ctinfo.ci_first_pm != NULL  ||  ct->c_begin == 0  ||
                ct->c_begin != ct->c_end) {
                putc ('\n', out);
            }
                ct->c_begin != ct->c_end) {
                putc ('\n', out);
            }