- switch (ctx->magic) {
- case M_MBOX:
- if ((ctx->fp =
- safe_fopen (ctx->path, flags & M_NEWFOLDER ? "w" : "a")) == NULL
- || mbox_lock_mailbox(ctx, 1, 1) != 0) {
- if (!ctx->fp)
- mutt_perror (ctx->path);
- else {
- mutt_error (_("Couldn't lock %s\n"), ctx->path);
- m_fclose(&ctx->fp);
- }
- return (-1);
+ if (ctx->magic == M_MBOX) {
+ if (!(ctx->fp = safe_fopen(ctx->path, flags & M_NEWFOLDER ? "w" : "a"))) {
+ mutt_perror(ctx->path);
+ return -1;