summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authororudge <orudge@openttd.org>2007-07-22 17:21:25 +0000
committerorudge <orudge@openttd.org>2007-07-22 17:21:25 +0000
commit6196ff12632709156eca342a15da7f530796b318 (patch)
tree267531ea4dff1355bbef20384d02257b60db028f /src
parent724ac18d1ee53ed034bfe170f66bde6702644c31 (diff)
downloadopenttd-6196ff12632709156eca342a15da7f530796b318.tar.xz
(svn r10651) -Fix: Fix chdir problem with open/save dialog on OS/2 (Paul Smedley)
Diffstat (limited to 'src')
-rw-r--r--src/os2.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/os2.cpp b/src/os2.cpp
index 6f7da9a41..9b08e9514 100644
--- a/src/os2.cpp
+++ b/src/os2.cpp
@@ -44,6 +44,8 @@ void FiosGetDrives()
_dos_getdrive(&save); // save original drive
#else
save = _getdrive(); // save original drive
+ char wd[MAX_PATH];
+ getcwd(wd, MAX_PATH);
total = 'z';
#endif
@@ -55,7 +57,7 @@ void FiosGetDrives()
for (disk = 'A';; disk++) {
_chdrive(disk);
#endif
- if (disk >= total) return;
+ if (disk >= total) break;
#ifndef __INNOTEK_LIBC__
_dos_getdrive(&disk2);
@@ -80,7 +82,7 @@ void FiosGetDrives()
#ifndef __INNOTEK_LIBC__
_dos_setdrive(save, &total);
#else
- _chdrive(save);
+ chdir(wd);
#endif
}