[neomutt-devel] [PATCH] Make the use of m instead of ctx consistent in hook.c

Elimar Riesebieter riesebie at lxtec.de
Sun Dec 2 10:11:37 CET 2018


This should prevent for segfaults creating new mails.

---
 hook.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hook.c b/hook.c
index 743189e93..e002be81f 100644
--- a/hook.c
+++ b/hook.c
@@ -483,12 +483,12 @@ void mutt_message_hook(struct Mailbox *m, struct Email *e, int type)
  * @param path    Buffer for path
  * @param pathlen Length of buffer
  * @param type    Type e.g. #MUTT_FCC_HOOK
- * @param ctx     Mailbox Context
+ * @param m       Mailbox Context
  * @param e       Email
  * @retval  0 Success
  * @retval -1 Failure
  */
-static int addr_hook(char *path, size_t pathlen, int type, struct Context *ctx,
+static int addr_hook(char *path, size_t pathlen, int type, struct Context *m,
                      struct Email *e)
 {
   struct Hook *hook = NULL;
@@ -502,10 +502,10 @@ static int addr_hook(char *path, size_t pathlen, int type, struct Context *ctx,
 
     if (hook->type & type)
     {
-      if ((mutt_pattern_exec(hook->pattern, 0, ctx->mailbox, e, &cache) > 0) ^
+      if ((mutt_pattern_exec(hook->pattern, 0, m, e, &cache) > 0) ^
           hook->regex.not)
       {
-        mutt_make_string_flags(path, pathlen, hook->command, ctx, e, MUTT_FORMAT_PLAIN);
+        mutt_make_string_flags(path, pathlen, hook->command, m, e, MUTT_FORMAT_PLAIN);
         return 0;
       }
     }
-- 
2.20.0.rc1


-- 
  From The Collaborative International Dictionary of English v.0.48 [gcide]:
  .
  arsehole \arse"hole`\ ([aum]rs"h[=o]l`), n.
         1. execretory opening at the end of the alimentary canal.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://mailman.neomutt.org/pipermail/neomutt-devel-neomutt.org/attachments/20181202/764a8b95/attachment.sig>


More information about the neomutt-devel mailing list