]> granicus.if.org Git - neomutt/commitdiff
Don't pass an empty filename to the default text editor when editing
authorTAKAHASHI Tamotsu <ttakah@lapis.plala.or.jp>
Sun, 14 Aug 2005 21:32:17 +0000 (21:32 +0000)
committerTAKAHASHI Tamotsu <ttakah@lapis.plala.or.jp>
Sun, 14 Aug 2005 21:32:17 +0000 (21:32 +0000)
non-plain text. Also don't clobber $content_type when parsing it.
Closes: #2038.
attach.c
send.c

index 3d6e56742c47c25c2a3b8c0e3be50f304d6ea5cb..5ba1cce4d6dcd51c7e5cadba7c6ccabb8cb75e7c 100644 (file)
--- a/attach.c
+++ b/attach.c
@@ -268,7 +268,7 @@ int mutt_edit_attachment (BODY *a)
   else if (a->type == TYPETEXT)
   {
     /* On text, default to editor */
-    mutt_edit_file (NONULL (Editor), newfile);
+    mutt_edit_file (NONULL (Editor), a->filename);
   }
   else
   {
diff --git a/send.c b/send.c
index f783fbabf5dba344779a403bb24ea18165f35e52..3de3e5d9a5369270a43383fe9e207ca0d4557437 100644 (file)
--- a/send.c
+++ b/send.c
@@ -1058,6 +1058,7 @@ ci_send_message (int flags,               /* send mode */
   /* save current value of "pgp_sign_as" */
   char *signas = NULL;
   char *tag = NULL, *err = NULL;
+  char *ctype;
 
   int rv = -1;
   
@@ -1122,7 +1123,9 @@ ci_send_message (int flags,               /* send mode */
     pbody->next = msg->content; /* don't kill command-line attachments */
     msg->content = pbody;
     
-    mutt_parse_content_type (ContentType, msg->content);
+    ctype = safe_strdup (ContentType);
+    mutt_parse_content_type (ctype, msg->content);
+    FREE (&ctype);
     msg->content->unlink = 1;
     msg->content->use_disp = 0;
     msg->content->disposition = DISPINLINE;