From DONOTREPLY at icculus.org Tue Dec 11 13:54:11 2007 From: DONOTREPLY at icculus.org (DONOTREPLY at icculus.org) Date: 11 Dec 2007 13:54:11 -0500 Subject: r918 - branches/stable-1.0 branches/stable-1.0/platform trunk trunk/platform Message-ID: <20071211185411.14319.qmail@icculus.org> Author: icculus Date: 2007-12-11 13:54:10 -0500 (Tue, 11 Dec 2007) New Revision: 918 Modified: branches/stable-1.0/CHANGELOG branches/stable-1.0/platform/win32.c trunk/CHANGELOG.txt trunk/platform/windows.c Log: Fixed wrong dir test in Windows code in both 1.0 and 1.1 (thanks, Dennis!). Modified: branches/stable-1.0/CHANGELOG =================================================================== --- branches/stable-1.0/CHANGELOG 2007-10-01 15:47:40 UTC (rev 917) +++ branches/stable-1.0/CHANGELOG 2007-12-11 18:54:10 UTC (rev 918) @@ -4,6 +4,7 @@ -- stuff in the stable-1.0 branch, backported from 2.0.0 dev branch, etc --- +12112007 - Fixed incorrect directory test in Windows code (thanks, Dennis!). 10012007 - More mingw32 fixes. 07122007 - Maybe fixed compile on mingw32. 07112007 - Fixed crash on zero-byte read/write (thanks, Ensiform!). Modified: branches/stable-1.0/platform/win32.c =================================================================== --- branches/stable-1.0/platform/win32.c 2007-10-01 15:47:40 UTC (rev 917) +++ branches/stable-1.0/platform/win32.c 2007-12-11 18:54:10 UTC (rev 918) @@ -970,7 +970,7 @@ int __PHYSFS_platformDelete(const char *path) { /* If filename is a folder */ - if (GetFileAttributes(path) == FILE_ATTRIBUTE_DIRECTORY) + if (GetFileAttributes(path) & FILE_ATTRIBUTE_DIRECTORY) { BAIL_IF_MACRO(!RemoveDirectory(path), win32strerror(), 0); } /* if */ Modified: trunk/CHANGELOG.txt =================================================================== --- trunk/CHANGELOG.txt 2007-10-01 15:47:40 UTC (rev 917) +++ trunk/CHANGELOG.txt 2007-12-11 18:54:10 UTC (rev 918) @@ -2,6 +2,7 @@ * CHANGELOG. */ +12112007 - Fixed incorrect directory test in Windows code (thanks, Dennis!). 10012007 - More mingw32 fixes. 07122007 - Maybe fixed compile on mingw32. 07112007 - Fixed crash on zero-byte read/write (thanks, Ensiform!). Modified: trunk/platform/windows.c =================================================================== --- trunk/platform/windows.c 2007-10-01 15:47:40 UTC (rev 917) +++ trunk/platform/windows.c 2007-12-11 18:54:10 UTC (rev 918) @@ -1208,7 +1208,7 @@ static int doPlatformDelete(LPWSTR wpath) { /* If filename is a folder */ - if (pGetFileAttributesW(wpath) == FILE_ATTRIBUTE_DIRECTORY) + if (pGetFileAttributesW(wpath) & FILE_ATTRIBUTE_DIRECTORY) { BAIL_IF_MACRO(!pRemoveDirectoryW(wpath), winApiStrError(), 0); } /* if */