Commit 4a8b0ce8 4a8b0ce879036a65bc72707b0911ce0b3a4f5783 by Sergey Poznyakoff

(mu_scheme_autodetect_p): Return true if scheme is the name of an existing file or directory.

1 parent 1f43050e
...@@ -1228,7 +1228,9 @@ mu_scheme_autodetect_p (const char *scheme, const char **path) ...@@ -1228,7 +1228,9 @@ mu_scheme_autodetect_p (const char *scheme, const char **path)
1228 *path += MU_FILE_SCHEME_LEN; 1228 *path += MU_FILE_SCHEME_LEN;
1229 return 1; 1229 return 1;
1230 } 1230 }
1231 if (strncmp (MU_PATH_SCHEME, scheme, MU_PATH_SCHEME_LEN) == 0) 1231 if (access (scheme, F_OK) == 0
1232 /* FIXME: this can return true even if the folder is unreadable */
1233 || strncmp (MU_PATH_SCHEME, scheme, MU_PATH_SCHEME_LEN) == 0)
1232 return 1; 1234 return 1;
1233 return 0; 1235 return 0;
1234 } 1236 }
......