Backported zip/qpak dir fix from dev branch to stable-1.0. stable-1.0
authorRyan C. Gordon <icculus@icculus.org>
Fri, 18 Feb 2011 12:44:30 -0500
branchstable-1.0
changeset 1144 a39b2d2f50b9
parent 1081 bee6d056c105
child 1147 ec620e3894df
Backported zip/qpak dir fix from dev branch to stable-1.0.
archivers/qpak.c
archivers/zip.c
--- a/archivers/qpak.c	Tue Mar 23 13:40:00 2010 -0400
+++ b/archivers/qpak.c	Fri Feb 18 12:44:30 2011 -0500
@@ -554,8 +554,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	Tue Mar 23 13:40:00 2010 -0400
+++ b/archivers/zip.c	Fri Feb 18 12:44:30 2011 -0500
@@ -586,8 +586,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 */