{
int rc = 0;
int new_or_changed;
- CONTEXT *ctx = NULL;
+ CONTEXT ctx;
if (option (OPTCHECKMBOXSIZE))
new_or_changed = sb->st_size > mailbox->size;
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);
}
}
/* 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;
}
#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
{