summaryrefslogtreecommitdiffstats
path: root/mx.c
diff options
context:
space:
mode:
authorRoger Cornelius <rac@tenzing.org>2017-04-26 15:40:34 -0700
committerRoger Cornelius <rac@tenzing.org>2017-04-26 15:40:34 -0700
commit77c149f966340898b9d176ca441da5e51084413f (patch)
tree0c08ebe3f2450af7b6f46cdc82b65cee2d0afc3a /mx.c
parentad40fb635a9014da343a3fda6626a59d8e02bc20 (diff)
Fix error message when opening a mailbox with no read permission. (closes #3934)
ctx->mx_ops ends up being NULL for both the case that ctx->magic is 0 and -1. This meant the mutt_perror() error message was never being printed, because the check for ctx->mx_ops == NULL was taking place first. Move the "ctx->magic == -1" check first, so mutt will print out an appropriate perror message in that case.
Diffstat (limited to 'mx.c')
-rw-r--r--mx.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mx.c b/mx.c
index 5e61798c..21f38fae 100644
--- a/mx.c
+++ b/mx.c
@@ -601,10 +601,10 @@ CONTEXT *mx_open_mailbox (const char *path, int flags, CONTEXT *pctx)
if (ctx->magic <= 0 || !ctx->mx_ops)
{
- if (ctx->magic == 0 || !ctx->mx_ops)
- mutt_error (_("%s is not a mailbox."), path);
- else if (ctx->magic == -1)
+ if (ctx->magic == -1)
mutt_perror(path);
+ else if (ctx->magic == 0 || !ctx->mx_ops)
+ mutt_error (_("%s is not a mailbox."), path);
mx_fastclose_mailbox (ctx);
if (!pctx)