diff options
author | Roger Cornelius <rac@tenzing.org> | 2017-04-26 15:40:34 -0700 |
---|---|---|
committer | Roger Cornelius <rac@tenzing.org> | 2017-04-26 15:40:34 -0700 |
commit | 77c149f966340898b9d176ca441da5e51084413f (patch) | |
tree | 0c08ebe3f2450af7b6f46cdc82b65cee2d0afc3a /mx.c | |
parent | ad40fb635a9014da343a3fda6626a59d8e02bc20 (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.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) |