- int i = 0, t = 0;
- struct stat st;
-
- /* first, test all non-local folders to avoid stat() call */
- for (i = 0; i < MailboxFormats->length; i++) {
- if (!MX_COMMAND(i,local))
- t = MX_COMMAND(i,mx_is_magic)(path, NULL);
- if (t >= 1)
- return (t-1);
- }
- if (stat (path, &st) == 0) {
- /* if stat() succeeded, keep testing until success and
- * pass stat() info so that we only need to do it once */
- for (i = 0; i < MailboxFormats->length; i++) {
- if (MX_COMMAND(i,local))
- t = MX_COMMAND(i,mx_is_magic)(path, &st);
- if (t >= 1)
- return (t-1);
+ int i = 0, t = 0;
+ struct stat st;
+
+ /* first, test all non-local folders to avoid stat() call */
+ for (i = 0; i < countof(mxfmts); i++) {
+ if (!mxfmts[i]->local)
+ t = mxfmts[i]->mx_is_magic(path, NULL);
+ if (t >= 1)
+ return (t-1);