From: TAKAHASHI Tamotsu Date: Sun, 14 Aug 2005 21:32:17 +0000 (+0000) Subject: Don't pass an empty filename to the default text editor when editing X-Git-Tag: mutt-1-5-11-rel~100 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f303ecdc482b5b3f15491f52acbc3c748ddae550;p=mutt 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. --- diff --git a/attach.c b/attach.c index 3d6e5674..5ba1cce4 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 f783fbab..3de3e5d9 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;