Backported zip/qpak dir fix from dev branch to stable-2.0. stable-2.0
authorRyan C. Gordon <icculus@icculus.org>
Fri, 18 Feb 2011 12:42:14 -0500
branchstable-2.0
changeset 1143 1eed20f2a6a8
parent 1141 2ad0dd5a701f
child 1146 d258bb74bf19
Backported zip/qpak dir fix from dev branch to stable-2.0.
archivers/qpak.c
archivers/zip.c
--- a/archivers/qpak.c	Thu Feb 17 15:02:20 2011 -0500
+++ b/archivers/qpak.c	Fri Feb 18 12:42:14 2011 -0500
@@ -478,8 +478,11 @@
 
             if (thispath[pathlen] == '\0') /* found entry? */
                 return(&a[middle]);
+            /* adjust search params, try again. */
+            else if (thispath[pathlen] > '/')
+                hi = middle - 1;
             else
-                hi = middle - 1;  /* adjust search params, try again. */
+                lo = middle + 1;
         } /* if */
     } /* while */
 
--- a/archivers/zip.c	Thu Feb 17 15:02:20 2011 -0500
+++ b/archivers/zip.c	Fri Feb 18 12:42:14 2011 -0500
@@ -544,8 +544,11 @@
 
             if (thispath[pathlen] == '\0') /* found entry? */
                 return(&a[middle]);
+            /* adjust search params, try again. */
+            else if (thispath[pathlen] > '/')
+                hi = middle - 1;
             else
-                hi = middle - 1;  /* adjust search params, try again. */
+                lo = middle + 1;
         } /* if */
     } /* while */