]> granicus.if.org Git - neomutt/commitdiff
Allow reply-hook to use ~h when replying from the index. Fixes regression introduce...
authorMichael Elkins <me@mutt.org>
Sat, 7 Apr 2007 23:22:49 +0000 (16:22 -0700)
committerMichael Elkins <me@mutt.org>
Sat, 7 Apr 2007 23:22:49 +0000 (16:22 -0700)
hook.c
pattern.c

diff --git a/hook.c b/hook.c
index f0f98f7e8bd20183b87697dce45afbcbcfc968a4..bee3c4878c9bb990b33abf608f87a1cc6ed29a90 100644 (file)
--- a/hook.c
+++ b/hook.c
@@ -157,7 +157,7 @@ int mutt_parse_hook (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err)
   if (data & (M_SENDHOOK | M_SEND2HOOK | M_SAVEHOOK | M_FCCHOOK | M_MESSAGEHOOK | M_REPLYHOOK))
   {
     if ((pat = mutt_pattern_comp (pattern.data,
-          (data & (M_SENDHOOK | M_SEND2HOOK | M_FCCHOOK | M_REPLYHOOK)) ? 0 : M_FULL_MSG,
+          (data & (M_SENDHOOK | M_SEND2HOOK | M_FCCHOOK)) ? 0 : M_FULL_MSG,
                                  err)) == NULL)
       goto error;
   }
index fcc03569eb88eab2937e0a0b74c402bd4d472c34..facf2a965b9bd9738b7c1164b9fd42c080dd25ad 100644 (file)
--- a/pattern.c
+++ b/pattern.c
@@ -1132,6 +1132,12 @@ mutt_pattern_exec (struct pattern_t *pat, pattern_exec_flag flags, CONTEXT *ctx,
     case M_BODY:
     case M_HEADER:
     case M_WHOLE_MSG:
+      /*
+       * ctx can be NULL in certain cases, such as when replying to a message from the attachment menu and
+       * the user has a reply-hook using "~h" (bug #2190).
+       */
+      if (!ctx)
+             return 0;
 #ifdef USE_IMAP
       /* IMAP search sets h->matched at search compile time */
       if (ctx->magic == M_IMAP && pat->stringmatch)