diff --git a/CHANGELOG.md b/CHANGELOG.md index 843f470..7553950 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,7 +24,9 @@ Categories Used: - Multi-threaded compression for gzip and snappy using gzp [\#348](https://github.com/ouch-org/ouch/pull/348) ([figsoda](https://github.com/figsoda)) -### Bug fixes +### Bug Fixes + +- Fix decompression of zip archives with files larger than 4GB [\#354](https://github.com/ouch-org/ouch/pull/354) ([figsoda](https://github.com/figsoda)) - Fix handling of unknown extensions during decompression [\#355](https://github.com/ouch-org/ouch/pull/355) ([figsoda](https://github.com/figsoda)) diff --git a/src/archive/zip.rs b/src/archive/zip.rs index 05af45d..fa0ab18 100644 --- a/src/archive/zip.rs +++ b/src/archive/zip.rs @@ -145,7 +145,9 @@ where W: Write + Seek, { let mut writer = zip::ZipWriter::new(writer); - let options = zip::write::FileOptions::default(); + // always use ZIP64 to allow compression of files larger than 4GB + // the format is widely supported and the extra 20B is negligible in most cases + let options = zip::write::FileOptions::default().large_file(true); let output_handle = Handle::from_path(output_path); #[cfg(not(unix))] @@ -219,7 +221,7 @@ where options }; - let mut file = fs::File::open(entry.path())?; + let mut file = fs::File::open(path)?; writer.start_file( path.to_str().unwrap(), options.last_modified_time(get_last_modified_time(&file)),