mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
(svn r10651) -Fix: Fix chdir problem with open/save dialog on OS/2 (Paul Smedley)
This commit is contained in:
parent
724ac18d1e
commit
6196ff1263
@ -44,6 +44,8 @@ void FiosGetDrives()
|
|||||||
_dos_getdrive(&save); // save original drive
|
_dos_getdrive(&save); // save original drive
|
||||||
#else
|
#else
|
||||||
save = _getdrive(); // save original drive
|
save = _getdrive(); // save original drive
|
||||||
|
char wd[MAX_PATH];
|
||||||
|
getcwd(wd, MAX_PATH);
|
||||||
total = 'z';
|
total = 'z';
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -55,7 +57,7 @@ void FiosGetDrives()
|
|||||||
for (disk = 'A';; disk++) {
|
for (disk = 'A';; disk++) {
|
||||||
_chdrive(disk);
|
_chdrive(disk);
|
||||||
#endif
|
#endif
|
||||||
if (disk >= total) return;
|
if (disk >= total) break;
|
||||||
|
|
||||||
#ifndef __INNOTEK_LIBC__
|
#ifndef __INNOTEK_LIBC__
|
||||||
_dos_getdrive(&disk2);
|
_dos_getdrive(&disk2);
|
||||||
@ -80,7 +82,7 @@ void FiosGetDrives()
|
|||||||
#ifndef __INNOTEK_LIBC__
|
#ifndef __INNOTEK_LIBC__
|
||||||
_dos_setdrive(save, &total);
|
_dos_setdrive(save, &total);
|
||||||
#else
|
#else
|
||||||
_chdrive(save);
|
chdir(wd);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user