]> granicus.if.org Git - neomutt/commitdiff
patch-0.96.1.vikas.forward_attachment.2
authorThomas Roessler <roessler@does-not-exist.org>
Wed, 24 Mar 1999 16:32:30 +0000 (16:32 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Wed, 24 Mar 1999 16:32:30 +0000 (16:32 +0000)
recvattach.c

index 217a59c3456593e82ce4fde0e4f091232f2c5647..b143a878a96df28d4da169c0baec222abb7d2364 100644 (file)
@@ -820,9 +820,22 @@ static void reply_attachment_list (int op, int tag, HEADER *hdr, BODY *body)
   if (op == SENDFORWARD && option (OPTFORWATTACH))
   {
     HEADER *newhdr = mutt_new_header();
-    mutt_prepare_edit_message (ctx, newhdr, hn);
+    char buffer [LONG_STRING];
+
+    if (mutt_prepare_edit_message (ctx, newhdr, hn) < 0)
+    {
+      mutt_free_header (&newhdr);
+      return;
+    }
+
     mutt_free_envelope (&newhdr->env);
     newhdr->env = mutt_new_envelope();
+
+    /* set the default subject for the message. */
+    buffer[0] = 0;
+    mutt_make_string (buffer, sizeof (buffer), NONULL(ForwFmt), ctx, hn);
+    newhdr->env->subject = safe_strdup (buffer);
+
     ci_send_message (0, newhdr, NULL, ctx, NULL);
   }
   else