(svn r9990) -Fix: MorphOS and AmigaOS do not like "//" in filenames as that means the same as "/../" in means in Unix.

This commit is contained in:
rubidium
2007-05-30 18:24:54 +00:00
parent 2bfc36c1ba
commit b17a89c53d
3 changed files with 15 additions and 13 deletions

View File

@@ -87,8 +87,11 @@ bool FiosIsValidFile(const char *path, const struct dirent *ent, struct stat *sb
if (FiosIsRoot(path)) {
snprintf(filename, lengthof(filename), "%s:%s", path, ent->d_name);
} else // XXX - only next line!
#else
assert(path[strlen(path) - 1] == PATHSEPCHAR);
if (strlen(path) > 2) assert(path[strlen(path) - 2] != PATHSEPCHAR);
#endif
snprintf(filename, lengthof(filename), "%s" PATHSEP "%s", path, ent->d_name);
snprintf(filename, lengthof(filename), "%s%s", path, ent->d_name);
return stat(filename, sb) == 0;
}