From: David Levine Date: Wed, 7 Jan 2015 03:39:42 +0000 (-0600) Subject: Another fix to convertarg handling of multipart/related. Two, X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/3a9d1ae106f135d9d6524284c02ae2bea424ca8b?hp=6b073f7b67a0afd64012ff7d00818ec1bd07b5f2 Another fix to convertarg handling of multipart/related. Two, actually. One is a simple bug fix, the other restricts concatenation to text/plain, not just text, parts. --- diff --git a/test/repl/test-convert b/test/repl/test-convert index 000f46fd..fd1d1f6f 100755 --- a/test/repl/test-convert +++ b/test/repl/test-convert @@ -20,7 +20,7 @@ actual=`mhpath +`/draft printf 'Local-Mailbox: recipient@example.com' >>"$MH" -# check -convertarg with multiple parts and no additional text in draft +# check -convertarg with multiple parts and additional text in draft cat >"$expected" <<'EOF' From: recipient@example.com To: sender@example.com @@ -74,7 +74,7 @@ require_locale en_US.utf-8 en_US.utf8 LC_ALL=en_US.UTF-8; export LC_ALL -# check -convertarg with multiple parts and additional text in draft +# check -convertarg with multiple parts and no additional text in draft cat >"$expected" <<'EOF' From: recipient@example.com To: sender@example.com @@ -135,6 +135,7 @@ Content-Transfer-Encoding: 8bit sender@example.com writes: +> This is a test. EOF cat >`mhpath new` <<'EOF' @@ -150,7 +151,7 @@ Content-Type: multipart/related; type="text/plain"; boundary="_002_" --_002_ Content-Type: text/plain - +This is a test. --_002_-- diff --git a/uip/mhbuildsbr.c b/uip/mhbuildsbr.c index dde5027c..0773a075 100644 --- a/uip/mhbuildsbr.c +++ b/uip/mhbuildsbr.c @@ -2160,7 +2160,7 @@ expand_pseudoheaders (CT ct, struct multipart *m, const char *infile, part->mp_part->c_ctinfo.ci_subtype, NULL); if (part->mp_part->c_type == CT_MULTIPART) { - expand_pseudoheaders (part->mp_part, mp, infile, + expand_pseudoheaders (part->mp_part, m, infile, convert_head); } else { const convert_list *c; @@ -2294,7 +2294,8 @@ expand_pseudoheader (CT ct, CT *text_plain_ct, struct multipart *m, if (reply_ct->c_type == CT_TEXT && reply_ct->c_subtype == TEXT_PLAIN) { if (! *text_plain_ct && m->mp_parts && m->mp_parts->mp_part && - m->mp_parts->mp_part->c_type == CT_TEXT) { + m->mp_parts->mp_part->c_type == CT_TEXT && + m->mp_parts->mp_part->c_subtype == TEXT_PLAIN) { *text_plain_ct = m->mp_parts->mp_part; /* Make sure that the charset is set in the text/plain part. */