X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=attach.c;h=3f6a9ac4d7f248835c5061cd28e0189019e64c13;hp=4afb1fb99a4e46cd58829e488292825876c4d8ec;hb=a8808601c98c76ec8344c8e4ba5a607d72c2805e;hpb=238b70e39b78f585c586bd51aef41988b3cc73d1 diff --git a/attach.c b/attach.c index 4afb1fb..3f6a9ac 100644 --- a/attach.c +++ b/attach.c @@ -18,6 +18,8 @@ #include #include +#include + #include "mutt.h" #include "handler.h" #include "recvattach.h" @@ -25,11 +27,10 @@ #include "mutt_curses.h" #include "keymap.h" #include "rfc1524.h" -#include "mime.h" #include "pager.h" #include "copy.h" #include "mx.h" -#include "mutt_crypt.h" +#include #include "lib/debug.h" @@ -65,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) @@ -321,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" : @@ -396,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 ||