X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=pattern.c;h=335337e66b9fead1ff2828581e68e84baf5d7bf6;hp=b1dba84476215d9d47a82b456132a2c679da0663;hb=10b7d54ecaa5c54622bf1239b57fa2e3359db0e1;hpb=91d0c04349c9345f0ee29a61cc18dfc144b60edc diff --git a/pattern.c b/pattern.c index b1dba84..335337e 100644 --- a/pattern.c +++ b/pattern.c @@ -19,13 +19,14 @@ #include #include +#include + #include "mutt.h" #include "handler.h" #include "enter.h" #include "mx.h" #include "keymap.h" #include "copy.h" -#include "mime.h" #ifdef USE_IMAP @@ -179,8 +180,8 @@ msg_search (CONTEXT *ctx, pattern_t* pat, int msgno) if (pat->op != M_HEADER) { mutt_parse_mime_message (ctx, h); - if (WithCrypto && (h->security & ENCRYPT) - && !crypt_valid_passphrase (h->security)) { + if ((h->security & ENCRYPT) && !crypt_valid_passphrase (h->security)) + { mx_close_message (&msg); if (fp) { fclose (fp); @@ -815,7 +816,7 @@ pattern_t *mutt_pattern_comp ( /* const */ char *s, int flags, BUFFER * err) return NULL; } /* compile the sub-expression */ - buf = str_substrdup (ps.dptr + 1, p); + buf = p_dupstr(ps.dptr + 1, p - ps.dptr - 1); if ((tmp = mutt_pattern_comp (buf, flags, err)) == NULL) { p_delete(&buf); mutt_pattern_free (&curlist); @@ -876,11 +877,11 @@ static int match_adrlist (pattern_t* pat, int match_personal, int alladdr, int n, ...) { va_list ap; - ADDRESS *a; + address_t *a; va_start (ap, n); for (; n; n--) { - for (a = va_arg (ap, ADDRESS *); a; a = a->next) { + for (a = va_arg (ap, address_t *); a; a = a->next) { if (pat->alladdr ^ ((a->mailbox && patmatch (pat, a->mailbox) == 0) || (match_personal && a->personal && @@ -902,7 +903,7 @@ static int match_reference (pattern_t* pat, LIST * refs) return 0; } -int mutt_is_list_recipient (int alladdr, ADDRESS * a1, ADDRESS * a2) +int mutt_is_list_recipient (int alladdr, address_t * a1, address_t * a2) { for (; a1; a1 = a1->next) if (alladdr ^ mutt_is_subscribed_list (a1)) @@ -913,7 +914,7 @@ int mutt_is_list_recipient (int alladdr, ADDRESS * a1, ADDRESS * a2) return alladdr; } -int mutt_is_list_cc (int alladdr, ADDRESS * a1, ADDRESS * a2) +int mutt_is_list_cc (int alladdr, address_t * a1, address_t * a2) { for (; a1; a1 = a1->next) if (alladdr ^ mutt_is_mail_list (a1)) @@ -924,7 +925,7 @@ int mutt_is_list_cc (int alladdr, ADDRESS * a1, ADDRESS * a2) return alladdr; } -static int match_user (int alladdr, ADDRESS * a1, ADDRESS * a2) +static int match_user (int alladdr, address_t * a1, address_t * a2) { for (; a1; a1 = a1->next) if (alladdr ^ mutt_addr_is_user (a1)) @@ -1068,20 +1069,12 @@ mutt_pattern_exec (struct pattern_t *pat, pattern_exec_flag flags, case M_COLLAPSED: return (pat->not ^ (h->collapsed && h->num_hidden > 1)); case M_CRYPT_SIGN: - if (!WithCrypto) - break; return (pat->not ^ ((h->security & SIGN) ? 1 : 0)); case M_CRYPT_VERIFIED: - if (!WithCrypto) - break; return (pat->not ^ ((h->security & GOODSIGN) ? 1 : 0)); case M_CRYPT_ENCRYPT: - if (!WithCrypto) - break; return (pat->not ^ ((h->security & ENCRYPT) ? 1 : 0)); case M_PGP_KEY: - if (!(WithCrypto & APPLICATION_PGP)) - break; return (pat->not ^ ((h->security & APPLICATION_PGP) && (h->security & PGPKEY))); case M_XLABEL: