From 3360e21e7b4f6f8dfc5890dccbc1178c88a36b7e Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Thu, 22 Nov 2018 12:24:00 +0000 Subject: [PATCH] factor out Context from mbox_open_append() --- mx.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/mx.c b/mx.c index 57aa14e49..968212f4b 100644 --- a/mx.c +++ b/mx.c @@ -171,18 +171,16 @@ int mx_access(const char *path, int flags) /** * mx_open_mailbox_append - Open a mailbox for appending - * @param ctx Mailbox + * @param m Mailbox * @param flags Flags, e.g. #MUTT_READONLY * @retval 0 Success * @retval -1 Failure */ -static int mx_open_mailbox_append(struct Context *ctx, int flags) +static int mx_open_mailbox_append(struct Mailbox *m, int flags) { - if (!ctx || !ctx->mailbox) + if (!m) return -1; - struct Mailbox *m = ctx->mailbox; - struct stat sb; m->append = true; @@ -233,7 +231,7 @@ static int mx_open_mailbox_append(struct Context *ctx, int flags) if (!m->mx_ops || !m->mx_ops->mbox_open_append) return -1; - return m->mx_ops->mbox_open_append(ctx->mailbox, flags); + return m->mx_ops->mbox_open_append(m, flags); } /** @@ -308,7 +306,7 @@ struct Context *mx_mbox_open(struct Mailbox *m, const char *path, int flags) if (flags & (MUTT_APPEND | MUTT_NEWFOLDER)) { - if (mx_open_mailbox_append(ctx, flags) != 0) + if (mx_open_mailbox_append(ctx->mailbox, flags) != 0) { mx_fastclose_mailbox(ctx); mutt_context_free(&ctx); -- 2.40.0