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 11431eed20f2a6a8
parent 1141 2ad0dd5a701f
child 1146 d258bb74bf19
Backported zip/qpak dir fix from dev branch to stable-2.0.
archivers/qpak.c
archivers/zip.c
     1.1 --- a/archivers/qpak.c	Thu Feb 17 15:02:20 2011 -0500
     1.2 +++ b/archivers/qpak.c	Fri Feb 18 12:42:14 2011 -0500
     1.3 @@ -478,8 +478,11 @@
     1.4  
     1.5              if (thispath[pathlen] == '\0') /* found entry? */
     1.6                  return(&a[middle]);
     1.7 +            /* adjust search params, try again. */
     1.8 +            else if (thispath[pathlen] > '/')
     1.9 +                hi = middle - 1;
    1.10              else
    1.11 -                hi = middle - 1;  /* adjust search params, try again. */
    1.12 +                lo = middle + 1;
    1.13          } /* if */
    1.14      } /* while */
    1.15  
     2.1 --- a/archivers/zip.c	Thu Feb 17 15:02:20 2011 -0500
     2.2 +++ b/archivers/zip.c	Fri Feb 18 12:42:14 2011 -0500
     2.3 @@ -544,8 +544,11 @@
     2.4  
     2.5              if (thispath[pathlen] == '\0') /* found entry? */
     2.6                  return(&a[middle]);
     2.7 +            /* adjust search params, try again. */
     2.8 +            else if (thispath[pathlen] > '/')
     2.9 +                hi = middle - 1;
    2.10              else
    2.11 -                hi = middle - 1;  /* adjust search params, try again. */
    2.12 +                lo = middle + 1;
    2.13          } /* if */
    2.14      } /* while */
    2.15