summaryrefslogtreecommitdiff
path: root/src/unix.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-05-30 18:24:54 +0000
committerrubidium <rubidium@openttd.org>2007-05-30 18:24:54 +0000
commitb17a89c53d13c95375be9e5f37d40585dd13a1fa (patch)
treed76a78317ffb96c698f89d9e5f89a731714c31b7 /src/unix.cpp
parent2bfc36c1ba22d186bfc013a06e3fd1cc9cfcd852 (diff)
downloadopenttd-b17a89c53d13c95375be9e5f37d40585dd13a1fa.tar.xz
(svn r9990) -Fix: MorphOS and AmigaOS do not like "//" in filenames as that means the same as "/../" in means in Unix.
Diffstat (limited to 'src/unix.cpp')
-rw-r--r--src/unix.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/unix.cpp b/src/unix.cpp
index 43429778d..9808503dd 100644
--- a/src/unix.cpp
+++ b/src/unix.cpp
@@ -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;
}