void imap_allow_reopen (CONTEXT *ctx)
{
- IMAP_DATA* idata = ctx->data;
- if (ctx && ctx->magic == MUTT_IMAP && idata->ctx == ctx)
+ IMAP_DATA *idata;
+ if (!ctx || !ctx->data || ctx->magic != MUTT_IMAP)
+ return;
+
+ idata = ctx->data;
+ if (idata->ctx == ctx)
idata->reopen |= IMAP_REOPEN_ALLOW;
}
void imap_disallow_reopen (CONTEXT *ctx)
{
- IMAP_DATA* idata = ctx->data;
- if (ctx && ctx->magic == MUTT_IMAP && idata->ctx == ctx)
+ IMAP_DATA *idata;
+ if (!ctx || !ctx->data || ctx->magic != MUTT_IMAP)
+ return;
+
+ idata = ctx->data;
+ if (idata->ctx == ctx)
idata->reopen &= ~IMAP_REOPEN_ALLOW;
}
{
t = mutt_new_replace_list();
t->rx = rx;
+ rx = NULL;
if (last)
last->next = t;
else
*list = t;
}
+ else
+ mutt_free_regexp(&rx);
/* Now t is the REPLACE_LIST* that we want to modify. It is prepared. */
t->template = safe_strdup(templ);
a = (ATTACH_MATCH *)type->data;
mutt_debug (5, "cbpc: %s %d/%s ?? %s/%s [%d]... ",
dflt ? "[OK] " : "[EXCL] ",
- b->type, b->subtype, a->major, a->minor, a->major_int);
+ b->type, b->subtype ? b->subtype : "*",
+ a->major, a->minor, a->major_int);
if ((a->major_int == TYPEANY || a->major_int == b->type) &&
- !regexec(&a->minor_rx, b->subtype, 0, NULL, 0))
+ (!b->subtype || !regexec(&a->minor_rx, b->subtype, 0, NULL, 0)))
{
mutt_debug (5, "yes\n");
return 1;