summaryrefslogtreecommitdiff
path: root/mailbox/mutil.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2006-07-22 08:18:14 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2006-07-22 08:18:14 +0000
commit4a8b0ce879036a65bc72707b0911ce0b3a4f5783 (patch)
treece38eedc623bd88741a971217c453cc4ccc07c4a /mailbox/mutil.c
parent1f43050ebd89fc50e069b36b84bb5fd617b980e3 (diff)
downloadmailutils-4a8b0ce879036a65bc72707b0911ce0b3a4f5783.tar.gz
mailutils-4a8b0ce879036a65bc72707b0911ce0b3a4f5783.tar.bz2
(mu_scheme_autodetect_p): Return true if scheme is the name of an existing file or directory.
Diffstat (limited to 'mailbox/mutil.c')
-rw-r--r--mailbox/mutil.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mailbox/mutil.c b/mailbox/mutil.c
index 373a2fc0c..ff74665db 100644
--- a/mailbox/mutil.c
+++ b/mailbox/mutil.c
@@ -1228,7 +1228,9 @@ mu_scheme_autodetect_p (const char *scheme, const char **path)
*path += MU_FILE_SCHEME_LEN;
return 1;
}
- if (strncmp (MU_PATH_SCHEME, scheme, MU_PATH_SCHEME_LEN) == 0)
+ if (access (scheme, F_OK) == 0
+ /* FIXME: this can return true even if the folder is unreadable */
+ || strncmp (MU_PATH_SCHEME, scheme, MU_PATH_SCHEME_LEN) == 0)
return 1;
return 0;
}

Return to:

Send suggestions and report system problems to the System administrator.