Fixed bug in directory search for zip and qpak archivers (thanks, Michal!)

This commit is contained in:
Ryan C. Gordon 2011-02-18 12:38:05 -05:00
parent 54f72a0b42
commit 660c7f9823
2 changed files with 8 additions and 2 deletions

View File

@ -434,8 +434,11 @@ static QPAKentry *qpak_find_entry(const QPAKinfo *info, const char *path,
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 */

View File

@ -585,8 +585,11 @@ static ZIPentry *zip_find_entry(const ZIPinfo *info, const char *path,
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 */