The mx_close_message is one of the few mx_* functions that don't have a
context as parameter. To make them more consistent, pass the context.
---
 attach.c     | 2 +-
 commands.c   | 2 +-
 copy.c       | 6 +++---
 editmsg.c    | 2 +-
 mailbox.h    | 2 +-
 mh.c         | 4 ++--
 mx.c         | 2 +-
 parse.c      | 2 +-
 pattern.c    | 4 ++--
 pop.c        | 2 +-
 postpone.c   | 4 ++--
 recvattach.c | 6 +++---
 sendlib.c    | 6 +++---
 13 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/attach.c b/attach.c
index ab810cc..84cdf6d 100644
--- a/attach.c
+++ b/attach.c
@@ -745,7 +745,7 @@ int mutt_save_attachment (FILE *fp, BODY *m, char *path, 
int flags, HEADER *hdr)
       else
        r = -1;
 
-      mx_close_message (&msg);
+      mx_close_message (&ctx, &msg);
       mx_close_mailbox (&ctx, NULL);
       return r;
     }
diff --git a/commands.c b/commands.c
index 4750121..c5811bd 100644
--- a/commands.c
+++ b/commands.c
@@ -993,7 +993,7 @@ static int _mutt_check_traditional_pgp (HEADER *h, int 
*redraw)
   }
   
   h->security |= PGP_TRADITIONAL_CHECKED;
-  mx_close_message (&msg);
+  mx_close_message (Context, &msg);
   return rv;
 }
 
diff --git a/copy.c b/copy.c
index 2ae5ea8..1ef441f 100644
--- a/copy.c
+++ b/copy.c
@@ -692,7 +692,7 @@ mutt_copy_message (FILE *fpout, CONTEXT *src, HEADER *hdr, 
int flags,
     dprint (1, (debugfile, "_mutt_copy_message failed to detect EOF!\n"));
     r = -1;
   }
-  mx_close_message (&msg);
+  mx_close_message (src, &msg);
   return r;
 }
 
@@ -728,7 +728,7 @@ _mutt_append_message (CONTEXT *dest, FILE *fpin, CONTEXT 
*src, HEADER *hdr,
   if (mx_commit_message (msg, dest) != 0)
     r = -1;
 
-  mx_close_message (&msg);
+  mx_close_message (dest, &msg);
   return r;
 }
 
@@ -742,7 +742,7 @@ mutt_append_message (CONTEXT *dest, CONTEXT *src, HEADER 
*hdr, int cmflags,
   if ((msg = mx_open_message (src, hdr->msgno)) == NULL)
     return -1;
   r = _mutt_append_message (dest, msg->fp, src, hdr, hdr->content, cmflags, 
chflags);
-  mx_close_message (&msg);
+  mx_close_message (src, &msg);
   return r;
 }
 
diff --git a/editmsg.c b/editmsg.c
index 5a2e8f5..57d8b1c 100644
--- a/editmsg.c
+++ b/editmsg.c
@@ -187,7 +187,7 @@ static int edit_one_message (CONTEXT *ctx, HEADER *cur)
   }
 
   rc = mx_commit_message (msg, &tmpctx);
-  mx_close_message (&msg);
+  mx_close_message (&tmpctx, &msg);
   
   mx_close_mailbox (&tmpctx, NULL);
   
diff --git a/mailbox.h b/mailbox.h
index bdbfeac..edce294 100644
--- a/mailbox.h
+++ b/mailbox.h
@@ -69,7 +69,7 @@ void mx_fastclose_mailbox (CONTEXT *);
 int mx_close_mailbox (CONTEXT *, int *);
 int mx_sync_mailbox (CONTEXT *, int *);
 int mx_commit_message (MESSAGE *, CONTEXT *);
-int mx_close_message (MESSAGE **);
+int mx_close_message (CONTEXT *, MESSAGE **);
 int mx_get_magic (const char *);
 int mx_set_magic (const char *);
 int mx_check_mailbox (CONTEXT *, int *);
diff --git a/mh.c b/mh.c
index c88d216..6a00cab 100644
--- a/mh.c
+++ b/mh.c
@@ -1650,7 +1650,7 @@ static int mh_rewrite_message (CONTEXT * ctx, int msgno)
     else
       rc = _mh_commit_message (ctx, dest, h, 0);
 
-    mx_close_message (&dest);
+    mx_close_message (ctx, &dest);
 
     if (rc == 0)
     {
@@ -1681,7 +1681,7 @@ static int mh_rewrite_message (CONTEXT * ctx, int msgno)
     }
   }
   else
-    mx_close_message (&dest);
+    mx_close_message (ctx, &dest);
 
   if (rc == -1 && restore)
   {
diff --git a/mx.c b/mx.c
index f5920d2..a6ce3b6 100644
--- a/mx.c
+++ b/mx.c
@@ -1392,7 +1392,7 @@ int mx_commit_message (MESSAGE *msg, CONTEXT *ctx)
 }
 
 /* close a pointer to a message */
-int mx_close_message (MESSAGE **msg)
+int mx_close_message (CONTEXT *ctx, MESSAGE **msg)
 {
   int r = 0;
 
diff --git a/parse.c b/parse.c
index 9ff8707..92cfeb0 100644
--- a/parse.c
+++ b/parse.c
@@ -969,7 +969,7 @@ void mutt_parse_mime_message (CONTEXT *ctx, HEADER *cur)
       if (WithCrypto)
         cur->security = crypt_query (cur->content);
 
-      mx_close_message (&msg);
+      mx_close_message (ctx, &msg);
     }
   } while (0);
 
diff --git a/pattern.c b/pattern.c
index 09cf315..ef3cf01 100644
--- a/pattern.c
+++ b/pattern.c
@@ -180,7 +180,7 @@ msg_search (CONTEXT *ctx, pattern_t* pat, int msgno)
        if (WithCrypto && (h->security & ENCRYPT)
             && !crypt_valid_passphrase(h->security))
        {
-         mx_close_message (&msg);
+         mx_close_message (ctx, &msg);
          if (s.fpout)
          {
            safe_fclose (&s.fpout);
@@ -239,7 +239,7 @@ msg_search (CONTEXT *ctx, pattern_t* pat, int msgno)
 
     FREE (&buf);
     
-    mx_close_message (&msg);
+    mx_close_message (ctx, &msg);
 
     if (option (OPTTHOROUGHSRC))
     {
diff --git a/pop.c b/pop.c
index 15c9979..bccdc9b 100644
--- a/pop.c
+++ b/pop.c
@@ -874,7 +874,7 @@ void pop_fetch_mail (void)
        ret = -3;
       }
 
-      mx_close_message (&msg);
+      mx_close_message (&ctx, &msg);
     }
 
     if (ret == 0 && delanswer == MUTT_YES)
diff --git a/postpone.c b/postpone.c
index f7a7a87..9e19da2 100644
--- a/postpone.c
+++ b/postpone.c
@@ -586,7 +586,7 @@ int mutt_prepare_template (FILE *fp, CONTEXT *ctx, HEADER 
*newhdr, HEADER *hdr,
        || b == NULL)
     {
  err:
-      mx_close_message (&msg);
+      mx_close_message (ctx, &msg);
       mutt_free_envelope (&newhdr->env);
       mutt_free_body (&newhdr->content);
       mutt_error _("Decryption failed.");
@@ -735,7 +735,7 @@ int mutt_prepare_template (FILE *fp, CONTEXT *ctx, HEADER 
*newhdr, HEADER *hdr,
 
   /* that's it. */
   if (bfp != fp) safe_fclose (&bfp);
-  if (msg) mx_close_message (&msg);
+  if (msg) mx_close_message (ctx, &msg);
 
   if (rv == -1)
   {
diff --git a/recvattach.c b/recvattach.c
index c709c06..fb31318 100644
--- a/recvattach.c
+++ b/recvattach.c
@@ -966,7 +966,7 @@ void mutt_view_attachments (HEADER *hdr)
 
     if ((hdr->security & ENCRYPT) && !crypt_valid_passphrase(hdr->security))
     {
-      mx_close_message (&msg);
+      mx_close_message (Context, &msg);
       return;
     }
     if ((WithCrypto & APPLICATION_SMIME) && (hdr->security & 
APPLICATION_SMIME))
@@ -1006,7 +1006,7 @@ void mutt_view_attachments (HEADER *hdr)
 
     if (need_secured && !secured)
     {
-      mx_close_message (&msg);
+      mx_close_message (Context, &msg);
       mutt_error _("Can't decrypt encrypted message!");
       return;
     }
@@ -1239,7 +1239,7 @@ void mutt_view_attachments (HEADER *hdr)
        break;
 
       case OP_EXIT:
-       mx_close_message (&msg);
+       mx_close_message (Context, &msg);
        hdr->attach_del = 0;
        while (idxmax-- > 0)
        {
diff --git a/sendlib.c b/sendlib.c
index ee47525..939919c 100644
--- a/sendlib.c
+++ b/sendlib.c
@@ -2573,7 +2573,7 @@ static int _mutt_bounce_message (FILE *fp, HEADER *h, 
ADDRESS *to, const char *r
   }
 
   if (msg)
-    mx_close_message (&msg);
+    mx_close_message (Context, &msg);
 
   return ret;
 }
@@ -2847,7 +2847,7 @@ int mutt_write_fcc (const char *path, HEADER *hdr, const 
char *msgid, int post,
       safe_fclose (&tempfp);
       unlink (tempfile);
       mx_commit_message (msg, &f);     /* XXX - really? */
-      mx_close_message (&msg);
+      mx_close_message (&f, &msg);
       mx_close_mailbox (&f, NULL);
       return -1;
     }
@@ -2876,7 +2876,7 @@ int mutt_write_fcc (const char *path, HEADER *hdr, const 
char *msgid, int post,
 
   if (mx_commit_message (msg, &f) != 0)
     r = -1;
-  mx_close_message (&msg);
+  mx_close_message (&f, &msg);
   mx_close_mailbox (&f, NULL);
 
   if (!post && need_buffy_cleanup)
-- 
2.8.3

Reply via email to