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
3e88fe66c9
commit
ee044c2a3c
1 changed files with 1 additions and 1 deletions
|
@ -456,7 +456,7 @@ impl<R: Read + io::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