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 */
}
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);
}
ctx->magic = mx_get_magic (path);
+#ifdef USE_COMPRESSED
if (ctx->magic == M_COMPRESSED)
mutt_open_read_compressed (ctx);
+#endif
if (ctx->magic == 0)
mutt_error (_("%s is not a mailbox."), path);
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) {