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:
parent
90fd957bc9
commit
722234711f
1 changed files with 1 additions and 1 deletions
|
@ -558,7 +558,7 @@ impl<R: Read + Seek> ZipArchive<R> {
|
||||||
|
|
||||||
let outpath = directory.as_ref().join(filepath);
|
let outpath = directory.as_ref().join(filepath);
|
||||||
|
|
||||||
if file.name().ends_with('/') {
|
if file.is_dir() {
|
||||||
fs::create_dir_all(&outpath)?;
|
fs::create_dir_all(&outpath)?;
|
||||||
} else {
|
} else {
|
||||||
if let Some(p) = outpath.parent() {
|
if let Some(p) = outpath.parent() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue