From f50227ad10ce66c468cafbadce711d7f345195d5 Mon Sep 17 00:00:00 2001 From: TAKAHASHI Tamotsu Date: Sun, 14 Aug 2005 21:32:17 +0000 Subject: [PATCH] Don't pass an empty filename to the default text editor when editing non-plain text. Also don't clobber $content_type when parsing it. Closes: #2038. --- attach.c | 2 +- send.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/attach.c b/attach.c index 3d6e56742..5ba1cce4d 100644 --- 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 f783fbabf..3de3e5d9a 100644 --- 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; -- 2.40.0