Rocco Rutte:
authorpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Thu, 7 Apr 2005 18:36:13 +0000 (18:36 +0000)
committerpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Thu, 7 Apr 2005 18:36:13 +0000 (18:36 +0000)
minor beautifications after folder modularization

git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@255 e385b8ad-14ed-0310-8656-cc95a2468c6d

mbox.c
mh.c
mx.c

diff --git a/mbox.c b/mbox.c
index 3d1a31c..f5342a7 100644 (file)
--- a/mbox.c
+++ b/mbox.c
@@ -1161,7 +1161,7 @@ int mbox_is_magic (const char* path) {
   FILE* f;
   char tmp[_POSIX_PATH_MAX];
 
-  if (stat (path, &st) == -1)
+  if (stat (path, &st) == -1 || S_ISDIR(st.st_mode))
     return (-1);
 
   if (st.st_size == 0) {
diff --git a/mh.c b/mh.c
index 5d8f036..c9f3d47 100644 (file)
--- a/mh.c
+++ b/mh.c
@@ -1972,7 +1972,7 @@ int maildir_is_magic (const char* path) {
   char tmp[_POSIX_PATH_MAX];
 
   if (stat (path, &st) == -1)
-    return (0);
+    return (-1);
   if (S_ISDIR (st.st_mode)) {
     snprintf (tmp, sizeof (tmp), "%s/cur", path);
     if (stat (tmp, &st) == 0 && S_ISDIR (st.st_mode))
diff --git a/mx.c b/mx.c
index 2a9e17b..c99d243 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -550,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) {