Fix directory check in extract function

The directory check is not robust and fails if the path uses the Windows style path separator and not the unix style. A function "is_dir" already exists and accounts for this so this change switches to using that function instead.
This commit is contained in:
Brett Simons 2024-01-02 21:20:13 -05:00 committed by Chris Hennick
parent 90fd957bc9
commit 722234711f
No known key found for this signature in database
GPG key ID: DA47AABA4961C509

View file

@ -558,7 +558,7 @@ impl<R: Read + Seek> ZipArchive<R> {
let outpath = directory.as_ref().join(filepath);
if file.name().ends_with('/') {
if file.is_dir() {
fs::create_dir_all(&outpath)?;
} else {
if let Some(p) = outpath.parent() {