Patched to compile on OS/2 again.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 21 Jul 2005 18:10:17 +0000
changeset 714 03c2e2ee0905
parent 711 78ef22ce8231
child 715 d6bf881b6e1e
Patched to compile on OS/2 again.
CHANGELOG
platform/os2.c
--- a/CHANGELOG	Wed Jul 13 15:21:21 2005 +0000
+++ b/CHANGELOG	Thu Jul 21 18:10:17 2005 +0000
@@ -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!).
--- a/platform/os2.c	Wed Jul 13 15:21:21 2005 +0000
+++ b/platform/os2.c	Thu Jul 21 18:10:17 2005 +0000
@@ -260,7 +260,8 @@
     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,7 +407,12 @@
     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] != '\\') ? "\\*.*" : "*.*");
 
@@ -414,7 +420,10 @@
                       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))