From d0ef9457f3d66db6b2f8a08e1aaf5786011f4d0f Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sun, 11 Apr 2021 00:41:08 +0100 Subject: [PATCH] Fix how 32-bit vs 16-bit OS/2 is detected in attributes setter. --- setter/src/os2/attr.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/setter/src/os2/attr.c b/setter/src/os2/attr.c index cf23847..11cb55b 100644 --- a/setter/src/os2/attr.c +++ b/setter/src/os2/attr.c @@ -45,16 +45,12 @@ void FileAttributes(const char* path) int i; ACTION_RET actionTaken = 0; -// 32 bit -#if(defined(__I386__) || defined(__i386__) || defined(__THW_INTEL) || defined(_M_I386)) + // 32 bit +#if(defined(__I386__) || defined(__i386__) || defined(__THW_INTEL) || defined(_M_I386) || defined(__386__)) FILESTATUS3 fileStatus = {{0}}; -#endif - -// 16 bit -#if(defined(__I86__) || defined(__i86__) || defined(_M_I86)) + ULONG driveNo = path[0] - '@'; +#else // 16 bit USHORT driveNo = path[0] - '@'; -#else // 32 bit - ULONG driveNo = path[0] - '@'; #endif if(driveNo > 32) driveNo -= 32; @@ -108,7 +104,7 @@ void FileAttributes(const char* path) wRc = DosWrite(handle, (PVOID)os2_attrs[i].contents, strlen(os2_attrs[i].contents), &actionTaken); // 32 bit -#if(defined(__I386__) || defined(__i386__) || defined(__THW_INTEL) || defined(_M_I386)) +#if(defined(__I386__) || defined(__i386__) || defined(__THW_INTEL) || defined(_M_I386) || defined(__386__)) // It operates over the handle so file must be closed after setting attribute fileStatus.attrFile = os2_attrs[i].attr; rc = DosSetFileInfo(handle, FIL_STANDARD, &fileStatus, sizeof(FILESTATUS3));