X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=attach.c;h=c311ba226ce0004ae1ab06b5b9b63a53702a43a0;hp=c59030996b4747e5f613e17aaa80bdf23725e15c;hb=10b7d54ecaa5c54622bf1239b57fa2e3359db0e1;hpb=2a06362a155582cd59ae2ef6f0df71694a7eede3 diff --git a/attach.c b/attach.c index c590309..c311ba2 100644 --- a/attach.c +++ b/attach.c @@ -66,7 +66,7 @@ int mutt_get_tmp_attachment (BODY * a) if ((fpin = fopen (a->filename, "r")) && (fpout = safe_fopen (tempfile, "w"))) { /* __FOPEN_CHECKED__ */ mutt_copy_stream (fpin, fpout); - str_replace (&a->filename, tempfile); + m_strreplace(&a->filename, tempfile); a->unlink = 1; if (a->stamp >= st.st_mtime) @@ -322,9 +322,11 @@ void mutt_check_lookup_list (BODY * b, char *type, int len) ascii_strncasecmp (type, t->data, i) == 0) || ascii_strcasecmp (type, t->data) == 0) { - BODY tmp = { 0 }; + BODY tmp; int n; + p_clear(&tmp, 1); + if ((n = mutt_lookup_mime_type (&tmp, b->filename)) != TYPEOTHER) { snprintf (type, len, "%s/%s", n == TYPEAUDIO ? "audio" : @@ -397,7 +399,7 @@ int mutt_view_attachment (FILE * fp, BODY * a, int flag, HEADER * hdr, int unlink_tempfile = 0; is_message = mutt_is_message_type (a->type, a->subtype); - if (WithCrypto && is_message && a->hdr && (a->hdr->security & ENCRYPT) && + if (is_message && a->hdr && (a->hdr->security & ENCRYPT) && !crypt_valid_passphrase (a->hdr->security)) return (rc); use_mailcap = (flag == M_MAILCAP ||