From: David Levine Date: Sun, 10 Apr 2016 15:16:55 +0000 (-0400) Subject: Fix to commit 84932d0a96c79bfb2f0384ebab806dc51a35f600 to X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/cbffd053d895b0f64a8bfefc4fe838431d3387d5?ds=inline;hp=--cc Fix to commit 84932d0a96c79bfb2f0384ebab806dc51a35f600 to insert blank line between header and content for non-text content. (cherry picked from commit fe36a7ee2f4304fd3797443d4f2f950d6dc2475d) --- cbffd053d895b0f64a8bfefc4fe838431d3387d5 diff --git a/test/mhbuild/test-attach b/test/mhbuild/test-attach index 3e20158a..3b285ef6 100755 --- a/test/mhbuild/test-attach +++ b/test/mhbuild/test-attach @@ -360,6 +360,50 @@ EOF check "$draft" "$expected" +# check that blank line is inserted between header and content + +cat > "$MH_TEST_DIR/Mail/oneline" < "$draft" < +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" < +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} diff --git a/uip/mhoutsbr.c b/uip/mhoutsbr.c index 456a2e27..0f3e9c1d 100644 --- a/uip/mhoutsbr.c +++ b/uip/mhoutsbr.c @@ -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. */ - 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); }