X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=recvattach.c;h=265a18c40d3f5611ee7cabd8d52641adbcf7013a;hp=2e161ac034351c698aafb15920f7c0bd352f7e41;hb=cf69ddd650f124d3aed242285434ba2b97fb4b79;hpb=c3e57678c8be193fc137854020f3a90887be97c9 diff --git a/recvattach.c b/recvattach.c index 2e161ac..265a18c 100644 --- a/recvattach.c +++ b/recvattach.c @@ -17,13 +17,16 @@ #include "mutt_menu.h" #include "rfc1524.h" #include "mime.h" -#include "mailbox.h" #include "attach.h" #include "mapping.h" #include "mx.h" #include "copy.h" #include "mutt_crypt.h" +#include "lib/mem.h" +#include "lib/intl.h" +#include "lib/str.h" + #include #include #include @@ -53,7 +56,7 @@ static struct mapping_t AttachHelp[] = { int mutt_extract_path (char *filename, char *path) { - char *tmp = safe_malloc (sizeof (char) * _POSIX_PATH_MAX); + char *tmp = mem_malloc (sizeof (char) * _POSIX_PATH_MAX); char *help_ptr; help_ptr = tmp; @@ -67,7 +70,7 @@ int mutt_extract_path (char *filename, char *path) } *help_ptr++ = *filename++; } - FREE (&tmp); + mem_free (&tmp); return 0; } @@ -92,11 +95,11 @@ void mutt_update_tree (ATTACHPTR ** idx, short idxlen) } if (idx[x]->tree) { - if (mutt_strcmp (idx[x]->tree, buf) != 0) - mutt_str_replace (&idx[x]->tree, buf); + if (str_cmp (idx[x]->tree, buf) != 0) + str_replace (&idx[x]->tree, buf); } else - idx[x]->tree = safe_strdup (buf); + idx[x]->tree = str_dup (buf); if (2 * (idx[x]->level + 2) < sizeof (buf) && idx[x]->level) { s = buf + 2 * (idx[x]->level - 1); @@ -117,7 +120,7 @@ ATTACHPTR **mutt_gen_attach_list (BODY * m, for (; m; m = m->next) { if (*idxlen == *idxmax) { - safe_realloc (&idx, sizeof (ATTACHPTR *) * ((*idxmax) += 5)); + mem_realloc (&idx, sizeof (ATTACHPTR *) * ((*idxmax) += 5)); for (i = *idxlen; i < *idxmax; i++) idx[i] = NULL; } @@ -135,7 +138,7 @@ ATTACHPTR **mutt_gen_attach_list (BODY * m, } else { if (!idx[*idxlen]) - idx[*idxlen] = (ATTACHPTR *) safe_calloc (1, sizeof (ATTACHPTR)); + idx[*idxlen] = (ATTACHPTR *) mem_calloc (1, sizeof (ATTACHPTR)); new = idx[(*idxlen)++]; new->content = m; @@ -524,7 +527,7 @@ void mutt_save_attachment_list (FILE * fp, int tag, BODY * top, HEADER * hdr, break; } - FREE (&directory); + mem_free (&directory); if (tag && menu) { menu->oldcurrent = menu->current; @@ -883,7 +886,7 @@ void mutt_view_attachments (HEADER * hdr) char helpstr[SHORT_STRING]; MUTTMENU *menu; - BODY *cur; + BODY *cur = NULL; MESSAGE *msg; FILE *fp; ATTACHPTR **idx = NULL; @@ -1074,7 +1077,7 @@ void mutt_view_attachments (HEADER * hdr) } #endif - if (WithCrypto && hdr->security) { + if (WithCrypto && (hdr->security & (~PGP_TRADITIONAL_CHECKED))) { mutt_message _ ("Deletion of attachments from encrypted messages is unsupported."); @@ -1172,7 +1175,7 @@ void mutt_view_attachments (HEADER * hdr) CHECK_ATTACH; if (!idx[menu->current]->content->hdr->env->followup_to || - mutt_strcasecmp (idx[menu->current]->content->hdr->env->followup_to, + str_casecmp (idx[menu->current]->content->hdr->env->followup_to, "poster") || query_quadoption (OPT_FOLLOWUPTOPOSTER, _("Reply by mail as poster prefers?")) != @@ -1215,12 +1218,12 @@ void mutt_view_attachments (HEADER * hdr) hdr->attach_del = 1; if (idx[idxmax]->content) idx[idxmax]->content->aptr = NULL; - FREE (&idx[idxmax]->tree); - FREE (&idx[idxmax]); + mem_free (&idx[idxmax]->tree); + mem_free (&idx[idxmax]); } if (hdr->attach_del) hdr->changed = 1; - FREE (&idx); + mem_free (&idx); idxmax = 0; if (WithCrypto && need_secured && secured) {