X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=mx.c;h=c99d24355187286cec5bee45424d499445420a57;hp=4f0c75b3f52d4d704e460f5a205d0eca1cf4c001;hb=b777618bc61046875b5c79c7126f64496c6e5a93;hpb=9aa2b46502673125013fc62fd125ff039f213c11 diff --git a/mx.c b/mx.c index 4f0c75b..c99d243 100644 --- a/mx.c +++ b/mx.c @@ -155,7 +155,6 @@ static int mx_get_idx (const char* path) { for (i = 0; i < MailboxFormats->length; i++) { t = MX_COMMAND(i,mx_is_magic)(path); - fprintf (stderr, " test %s for %i == %i\n", NONULL(path), i, t); if (t >= 1) return (t-1); /* use type as index for array */ } @@ -331,10 +330,8 @@ int mx_get_magic (const char *path) { if (safe_strlen (path) == 0) return (-1); - if ((i = mx_get_idx (path)) >= 0) { - fprintf (stderr, "%s is %i\n", NONULL(path), i); + if ((i = mx_get_idx (path)) >= 0) return (MX_COMMAND(i,type)); - } return (-1); } @@ -553,8 +550,7 @@ CONTEXT *mx_open_mailbox (const char *path, int flags, CONTEXT * pctx) if (!ctx->quiet) mutt_message (_("Reading %s..."), ctx->path); - if ((rc = mx_get_idx (ctx->path)) >= 0) - rc = MX_COMMAND(rc,mx_open_mailbox)(ctx); + rc = MX_COMMAND(ctx->magic-1,mx_open_mailbox)(ctx); if (rc == 0) { if ((flags & M_NOSORT) == 0) {