Skip to content

Commit

Permalink
Patched to compile on OS/2 again.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jul 21, 2005
1 parent f114094 commit 507b099
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Expand Up @@ -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!).
Expand Down
15 changes: 12 additions & 3 deletions platform/os2.c
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 507b099

Please sign in to comment.