Index: mailbox/registrar.c =================================================================== RCS file: /cvsroot/mailutils/mailutils/mailbox/registrar.c,v retrieving revision 1.15 diff -a -w -u -r1.15 registrar.c --- mailbox/registrar.c 2 Jun 2004 11:03:46 -0000 1.15 +++ mailbox/registrar.c 13 Jul 2004 13:04:39 -0000 @@ -56,8 +56,19 @@ registrar_record (record_t record) { list_t list; + int (*add_to_list) __P ((list_t, void *)) = NULL; + registrar_get_list (&list); - return list_append (list, record); + + /* We want the MU_PATH_SCHEME to be the last resort in folder_create() + * therefore we put it last on the list while all others are put first. + */ + if (strncmp (record->scheme, MU_PATH_SCHEME, MU_PATH_SCHEME_LEN) == 0) + add_to_list = list_append; + else + add_to_list = list_prepend; + + return add_to_list (list, record); } int Index: mailbox/mbox/folder.c =================================================================== RCS file: /cvsroot/mailutils/mailutils/mailbox/mbox/folder.c,v retrieving revision 1.21 diff -a -w -u -r1.21 folder.c --- mailbox/mbox/folder.c 2 Jun 2004 11:03:59 -0000 1.21 +++ mailbox/mbox/folder.c 13 Jul 2004 13:04:39 -0000 @@ -59,6 +59,10 @@ }; record_t mbox_record = &_mbox_record; +/* Path record can handle directories, but this under the + * condition that it is put last on the registrar_list. + * Otherwise the path_record would give a false positive + * for MH and maildir records as well. */ static int _path_is_scheme (record_t record, const char *url) { @@ -67,15 +71,15 @@ if (!url || !record->scheme) return 0; - if (mu_scheme_autodetect_p (url, &path)) /* implies if (strncmp (record->scheme, url, strlen(record->scheme)) == 0)*/ + if (mu_scheme_autodetect_p (url, &path)) { struct stat st; if (stat (path, &st) < 0) return 1; /* mailbox_open will complain */ - return S_ISREG (st.st_mode) || S_ISCHR (st.st_mode); + return S_ISREG (st.st_mode) || S_ISCHR (st.st_mode) || S_ISDIR (st.st_mode); } return 0; } @@ -253,7 +257,7 @@ /* The listing is not recursif and we use glob() some expansion for us. Unfortunately glob() does not expand the '~'. We also return - The full pathname so it can be use to create other folders. */ + the full pathname so it can be use to create other folders. */ static int folder_mbox_list (folder_t folder, const char *dirname, const char *pattern, struct folder_list *pflist) @@ -430,4 +434,3 @@ *pauth = folder->authority; return status; } -