In OS/2 change current drive before changing current directory.

This commit is contained in:
2021-04-05 21:51:56 +01:00
parent 7c8582bde4
commit 7626ea03f8
9 changed files with 127 additions and 0 deletions

View File

@@ -47,6 +47,23 @@ void FileAttributes(const char* path)
FILESTATUS3 fileStatus = {{0}};
#endif
// 16 bit
#if(defined(__I86__) || defined(__i86__) || defined(_M_I86))
USHORT driveNo = path[0] - '@';
#else // 32 bit
ULONG driveNo = path[0] - '@';
#endif
if(driveNo > 32) driveNo -= 32;
rc = __os2_chdisk(driveNo);
if(rc)
{
log_write("Cannot change to specified drive, not continuing.\n");
return;
}
drivePath[0] = path[0];
drivePath[1] = ':';
drivePath[2] = '\\';