diff options
author | Masayuki Moriyama <Masayuki Moriyama> | 2007-03-06 17:45:49 -0800 |
---|---|---|
committer | Masayuki Moriyama <Masayuki Moriyama> | 2007-03-06 17:45:49 -0800 |
commit | 505d282ba89d5070af64b7f67dcce75730996423 (patch) | |
tree | 281ce7b3b01cc48c3d6a14722b7c4b6643153afb /hook.c | |
parent | 041c6f73da6f445ba18d0fe8fc53cf863eef7eb8 (diff) |
Allow iconv-hook to use virtual charsets as targets. (closes: #1269)
Diffstat (limited to 'hook.c')
-rw-r--r-- | hook.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -92,12 +92,16 @@ int mutt_parse_hook (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err) memset (&pattern, 0, sizeof (pattern)); pattern.data = safe_strdup (path); } - else if (DefaultHook && !(data & (M_CHARSETHOOK | M_ACCOUNTHOOK)) + else if (DefaultHook && !(data & (M_CHARSETHOOK | M_ICONVHOOK | M_ACCOUNTHOOK)) && (!WithCrypto || !(data & M_CRYPTHOOK)) ) { char tmp[HUGE_STRING]; + /* At this stage remain only message-hooks, reply-hooks, send-hooks, + * send2-hooks, save-hooks, and fcc-hooks: All those allowing full + * patterns. If given a simple regexp, we expand $default_hook. + */ strfcpy (tmp, pattern.data, sizeof (tmp)); mutt_check_simple (tmp, sizeof (tmp), DefaultHook); FREE (&pattern.data); @@ -159,9 +163,10 @@ int mutt_parse_hook (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err) } else { + /* Hooks not allowing full patterns: Check syntax of regexp */ rx = safe_malloc (sizeof (regex_t)); #ifdef M_CRYPTHOOK - if ((rc = REGCOMP (rx, NONULL(pattern.data), ((data & (M_CRYPTHOOK|M_CHARSETHOOK)) ? REG_ICASE : 0))) != 0) + if ((rc = REGCOMP (rx, NONULL(pattern.data), ((data & (M_CRYPTHOOK|M_CHARSETHOOK|M_ICONVHOOK)) ? REG_ICASE : 0))) != 0) #else if ((rc = REGCOMP (rx, NONULL(pattern.data), (data & (M_CHARSETHOOK|M_ICONVHOOK)) ? REG_ICASE : 0)) != 0) #endif /* M_CRYPTHOOK */ |