Skip to content
Permalink
Browse files
Patched to compile on OS/2 again.
  • Loading branch information
icculus committed Jul 21, 2005
1 parent f114094 commit 507b099d5dfdfbbdf247eba7927a3b4761f4d0ca
Showing with 13 additions and 3 deletions.
  1. +1 −0 CHANGELOG
  2. +12 −3 platform/os2.c
@@ -2,6 +2,7 @@
* CHANGELOG.
*/

07212005 - Patched to compile on OS/2 again.
07132005 - Updated zlib to 1.2.2, and patched it for this security hole:
http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2005-2096
06122005 - Added support for mingw to Unix build process (thanks, Matze!).
@@ -260,7 +260,8 @@ void __PHYSFS_platformDetectAvailableCDs(PHYSFS_StringCallback cb, void *data)
ULONG drivemap = 0;
ULONG i, bit;
APIRET rc = DosQueryCurrentDisk(&dummy, &drivemap);
BAIL_IF_MACRO(os2err(rc) != NO_ERROR, NULL, retval);
if (os2err(rc) != NO_ERROR)
return;

for (i = 0, bit = 1; i < 26; i++, bit <<= 1)
{
@@ -406,15 +407,23 @@ void __PHYSFS_platformEnumerateFiles(const char *dirname,
ULONG count = 1;
APIRET rc;

BAIL_IF_MACRO(strlen(dirname) > sizeof (spec) - 5, ERR_BAD_FILENAME, NULL);
if (strlen(dirname) > sizeof (spec) - 5)
{
__PHYSFS_setError(ERR_BAD_FILENAME);
return;
} /* if */

strcpy(spec, dirname);
strcat(spec, (spec[strlen(spec) - 1] != '\\') ? "\\*.*" : "*.*");

rc = DosFindFirst(spec, &hdir,
FILE_DIRECTORY | FILE_ARCHIVED |
FILE_READONLY | FILE_HIDDEN | FILE_SYSTEM,
&fb, sizeof (fb), &count, FIL_STANDARD);
BAIL_IF_MACRO(os2err(rc) != NO_ERROR, NULL, 0);

if (os2err(rc) != NO_ERROR)
return;

while (count == 1)
{
if ((strcmp(fb.achName, ".") != 0) && (strcmp(fb.achName, "..") != 0))

0 comments on commit 507b099

Please sign in to comment.