summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--buffy.c18
-rw-r--r--mx.c12
2 files changed, 14 insertions, 16 deletions
diff --git a/buffy.c b/buffy.c
index 50bda350..508136a5 100644
--- a/buffy.c
+++ b/buffy.c
@@ -417,7 +417,7 @@ static int buffy_mbox_check (BUFFY* mailbox, struct stat *sb, int check_stats)
{
int rc = 0;
int new_or_changed;
- CONTEXT *ctx = NULL;
+ CONTEXT ctx;
if (option (OPTCHECKMBOXSIZE))
new_or_changed = sb->st_size > mailbox->size;
@@ -446,15 +446,15 @@ static int buffy_mbox_check (BUFFY* mailbox, struct stat *sb, int check_stats)
if (check_stats &&
(mailbox->stats_last_checked < sb->st_mtime))
{
- if ((ctx = mx_open_mailbox (mailbox->path,
- MUTT_READONLY | MUTT_QUIET | MUTT_NOSORT | MUTT_PEEK,
- NULL)) != NULL)
+ if (mx_open_mailbox (mailbox->path,
+ MUTT_READONLY | MUTT_QUIET | MUTT_NOSORT | MUTT_PEEK,
+ &ctx) != NULL)
{
- mailbox->msg_count = ctx->msgcount;
- mailbox->msg_unread = ctx->unread;
- mailbox->msg_flagged = ctx->flagged;
- mailbox->stats_last_checked = ctx->mtime;
- mx_close_mailbox (ctx, 0);
+ mailbox->msg_count = ctx.msgcount;
+ mailbox->msg_unread = ctx.unread;
+ mailbox->msg_flagged = ctx.flagged;
+ mailbox->stats_last_checked = ctx.mtime;
+ mx_close_mailbox (&ctx, 0);
}
}
diff --git a/mx.c b/mx.c
index 86d02ced..7af22aae 100644
--- a/mx.c
+++ b/mx.c
@@ -800,7 +800,7 @@ static int sync_mailbox (CONTEXT *ctx, int *index_hint)
/* move deleted mails to the trash folder */
static int trash_append (CONTEXT *ctx)
{
- CONTEXT *ctx_trash;
+ CONTEXT ctx_trash;
int i;
struct stat st, stc;
int opt_confappend, rc;
@@ -840,22 +840,20 @@ static int trash_append (CONTEXT *ctx)
}
#endif
- if ((ctx_trash = mx_open_mailbox (TrashPath, MUTT_APPEND, NULL)) != NULL)
+ if (mx_open_mailbox (TrashPath, MUTT_APPEND, &ctx_trash) != NULL)
{
/* continue from initial scan above */
for (; i < ctx->msgcount ; i++)
if (ctx->hdrs[i]->deleted && (!ctx->hdrs[i]->purge))
{
- if (mutt_append_message (ctx_trash, ctx, ctx->hdrs[i], 0, 0) == -1)
+ if (mutt_append_message (&ctx_trash, ctx, ctx->hdrs[i], 0, 0) == -1)
{
- mx_close_mailbox (ctx_trash, NULL);
- FREE (&ctx_trash);
+ mx_close_mailbox (&ctx_trash, NULL);
return -1;
}
}
- mx_close_mailbox (ctx_trash, NULL);
- FREE (&ctx_trash);
+ mx_close_mailbox (&ctx_trash, NULL);
}
else
{