zip-rs / zip-old

Zip implementation in Rust
MIT License
731 stars 204 forks source link

Fix directory check in extract function on Windows #425

Closed brettsimons closed 5 months ago

brettsimons commented 9 months ago

The directory check inside the extract function 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.

brettsimons commented 7 months ago

Hi @Plecra, I believe this topic was touched on previously in #249 and #366 but I wanted to propose this change which leverages the ZipFile is_dir function instead of explicitly getting the file name and checking for the path separator. This helps keep the directory check consistent and fixes the issue of zip files created on Windows where the ending path separator is '\' instead of '/' since is_dir already supports both scenarios.

Pr0methean commented 5 months ago

This repo is no longer maintained, so I've replaced this PR with https://github.com/zip-rs/zip2/pull/52.