X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=muttlib.c;h=fbd456450ca28f395d0aa7938ffe75ef81bd9fdb;hb=583704c848689d6621e811e28e0014e11d141933;hp=29380660ae430d266b31aa76d1418194326bec45;hpb=ac813896ca32d850febc2d95065ac4fa040f11f9;p=apps%2Fmadmutt.git diff --git a/muttlib.c b/muttlib.c index 2938066..fbd4564 100644 --- a/muttlib.c +++ b/muttlib.c @@ -12,16 +12,18 @@ # include "config.h" #endif -#include #include -#include -#include -#include #include -#include #include -#include +#include +#include +#include +#include +#include #include +#include +#include +#include #include #include @@ -30,7 +32,6 @@ #include #include #include -#include #include #include @@ -38,6 +39,7 @@ #include #include +#include "alias.h" #include "mutt.h" #include "mx.h" #include "attach.h" @@ -178,11 +180,8 @@ void mutt_free_body (BODY ** p) if (b->parameter) parameter_list_wipe(&b->parameter); if (b->unlink && b->filename) { - debug_print (1, ("unlinking %s.\n", b->filename)); unlink (b->filename); } - else if (b->filename) - debug_print (1, ("not unlinking %s.\n", b->filename)); p_delete(&b->filename); p_delete(&b->content); @@ -436,16 +435,15 @@ void mutt_set_parameter (const char *attribute, const char *value, void mutt_delete_parameter (const char *attribute, PARAMETER ** p) { - PARAMETER *q; + while (*p) { + if (!ascii_strcasecmp(attribute, (*p)->attribute)) { + PARAMETER *q = parameter_list_pop(p); + parameter_delete(&q); + return; + } - for (q = *p; q; p = &q->next, q = q->next) { - if (ascii_strcasecmp (attribute, q->attribute) == 0) { - *p = q->next; - q->next = NULL; - parameter_list_wipe(&q); - return; + p = &(*p)->next; } - } } /* returns 1 if Mutt can't display this type of data, 0 otherwise */ @@ -549,7 +547,6 @@ void _mutt_mktemp (char *s, const char *src, int line) snprintf (s, _POSIX_PATH_MAX, "%s/madmutt-%s-%d-%d-%d-%x%x", NONULL (Tempdir), NONULL (Hostname), (int) getuid (), (int) getpid (), Counter++, (unsigned int) rand(), (unsigned int) rand()); - debug_print (1, ("%s:%d: mutt_mktemp returns \"%s\".\n", src, line, s)); unlink (s); } @@ -1207,8 +1204,6 @@ int mutt_match_spam_list (const char *s, SPAM_LIST * l, char *text, int x) /* Does this pattern match? */ if (regexec(l->rx->rx, s, l->nmatch, (regmatch_t *)pmatch, (int) 0) == 0) { - debug_print (5, ("%s matches %s\n%d subst", s, l->rx->pattern, l->rx->rx->re_nsub)); - /* Copy template into text, with substitutions. */ for (p = l->template; *p;) { if (*p == '%') { @@ -1223,7 +1218,6 @@ int mutt_match_spam_list (const char *s, SPAM_LIST * l, char *text, int x) } } text[tlen] = '\0'; - debug_print (5, ("\"%s\"\n", text)); return 1; } }