summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatthijs <matthijs@openttd.org>2005-05-15 14:01:35 +0000
committermatthijs <matthijs@openttd.org>2005-05-15 14:01:35 +0000
commitabdf4ead8748904a2cd347cb4b22b45485677952 (patch)
treec0a136574fd5aea5fab219fbfb9d6acff27ddb27
parent1436fa9d48856c19bdf6b4cc2006033ed330fa76 (diff)
downloadopenttd-abdf4ead8748904a2cd347cb4b22b45485677952.tar.xz
(svn r2321) - Fix: [ 1202286 ] On OS/2 you get a double backslash in your filename after browsing to the root dir of a drive and "." and ".." are incorrectly displayed. (orudge)
-rw-r--r--os2.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/os2.c b/os2.c
index 57d7fe4fd..06006c763 100644
--- a/os2.c
+++ b/os2.c
@@ -114,8 +114,8 @@ FiosItem *FiosGetSavegameList(int *num, int mode)
while ((dirent = readdir(dir)) != NULL) {
append_path(filename, _fios_path, dirent->d_name);
if (!stat(filename, &sb) && S_ISDIR(sb.st_mode) &&
- strcmp(filename, ".") != 0 &&
- strcmp(filename, "..") != 0) {
+ strcmp(dirent->d_name, ".") != 0 &&
+ strcmp(dirent->d_name, "..") != 0) {
fios = FiosAlloc();
fios->type = FIOS_TYPE_DIR;
fios->mtime = 0;
@@ -243,8 +243,8 @@ FiosItem *FiosGetScenarioList(int *num, int mode)
while ((dirent = readdir(dir)) != NULL) {
append_path(filename, _fios_path, dirent->d_name);
if (!stat(filename, &sb) && S_ISDIR(sb.st_mode) &&
- strcmp(filename, ".") != 0 &&
- strcmp(filename, "..") != 0) {
+ strcmp(dirent->d_name, ".") != 0 &&
+ strcmp(dirent->d_name, "..") != 0) {
fios = FiosAlloc();
fios->type = FIOS_TYPE_DIR;
fios->mtime = 0;
@@ -357,7 +357,7 @@ char *FiosBrowseTo(const FiosItem *item)
case FIOS_TYPE_DIR:
s = strchr(item->name, '\\');
if (s != NULL) *s = '\0';
- strcat(path, "\\");
+ if (path[3]!= '\0' ) strcat(path, "\\");
strcat(path, item->name);
break;