X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=hook.c;h=aa0d47857a4db245b31ebe52bd7e6c74f6b54daf;hp=bb8e30f9c16bd49f53b53c7ba29f61a7d68f6927;hb=2a2f2f9a5bad73c883b7f9c9b4166d932b6aaf37;hpb=ac813896ca32d850febc2d95065ac4fa040f11f9 diff --git a/hook.c b/hook.c index bb8e30f..aa0d478 100644 --- a/hook.c +++ b/hook.c @@ -25,6 +25,7 @@ #include #include "mutt.h" +#include "alias.h" #include "mx.h" #include #include "compress.h" @@ -411,30 +412,29 @@ void mutt_select_fcc (char *path, ssize_t pathlen, HEADER * hdr) mutt_pretty_mailbox (path); } -static char *_mutt_string_hook (const char *match, int hook) +static const char *_mutt_string_hook (const char *match, int hook) { HOOK *tmp = Hooks; for (; tmp; tmp = tmp->next) { - if ((tmp->type & hook) && ((match && - regexec (tmp->rx.rx, match, 0, NULL, - 0) == 0) ^ tmp->rx.not)) + if ((tmp->type & hook) + && ((match && regexec(tmp->rx.rx, match, 0, NULL, 0) == 0) ^ tmp->rx.not)) return (tmp->command); } return (NULL); } -char *mutt_charset_hook (const char *chs) +const char *mutt_charset_hook (const char *chs) { return _mutt_string_hook (chs, M_CHARSETHOOK); } -char *mutt_iconv_hook (const char *chs) +const char *mutt_iconv_hook (const char *chs) { return _mutt_string_hook (chs, M_ICONVHOOK); } -char *mutt_crypt_hook (address_t * adr) +const char *mutt_crypt_hook (address_t * adr) { return _mutt_string_hook (adr->mailbox, M_CRYPTHOOK); }