]> diplodocus.org Git - nmh/commitdiff
Another fix to convertarg handling of multipart/related. Two,
authorDavid Levine <levinedl@acm.org>
Wed, 7 Jan 2015 03:39:42 +0000 (21:39 -0600)
committerDavid Levine <levinedl@acm.org>
Wed, 7 Jan 2015 03:39:42 +0000 (21:39 -0600)
actually.  One is a simple bug fix, the other restricts concatenation
to text/plain, not just text, parts.

test/repl/test-convert
uip/mhbuildsbr.c

index 000f46fd404df6defd1ce2f54194353373d5b542..fd1d1f6fbc9a58c4c7ff4d1770ec233e82cd704e 100755 (executable)
@@ -20,7 +20,7 @@ actual=`mhpath +`/draft
 printf 'Local-Mailbox: recipient@example.com' >>"$MH"
 
 
 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
 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
 
 
 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
 cat >"$expected" <<'EOF'
 From: recipient@example.com
 To: sender@example.com
@@ -135,6 +135,7 @@ Content-Transfer-Encoding: 8bit
 
 sender@example.com writes:
 
 
 sender@example.com writes:
 
+> This is a test.
 EOF
 
 cat >`mhpath new` <<'EOF'
 EOF
 
 cat >`mhpath new` <<'EOF'
@@ -150,7 +151,7 @@ Content-Type: multipart/related; type="text/plain"; boundary="_002_"
 --_002_
 Content-Type: text/plain
 
 --_002_
 Content-Type: text/plain
 
-
+This is a test.
 
 --_002_--
 
 
 --_002_--
 
index dde5027cb78dfc186f51243bf35d113af0b9b13d..0773a075516e646b1e7587a18b1d0b4d6d990684 100644 (file)
@@ -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) {
                             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;
                                           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  &&
     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. */
             *text_plain_ct = m->mp_parts->mp_part;
             /* Make sure that the charset is set in the text/plain
                part. */