From 722234711f7b62b71f4ffaa0ceed6f58391a7949 Mon Sep 17 00:00:00 2001 From: Brett Simons Date: Tue, 2 Jan 2024 21:20:13 -0500 Subject: [PATCH] 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. --- src/read.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/read.rs b/src/read.rs index b1cb0300..0a39faef 100644 --- a/src/read.rs +++ b/src/read.rs @@ -558,7 +558,7 @@ impl ZipArchive { 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() {