Skip to content

Commit

Permalink
Add Deflate64 method + test file (doesn't support it yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
fasterthanlime committed Jan 26, 2024
1 parent 47e65d2 commit 295cb65
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion crates/jean/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ fn do_main(cli: Cli) -> Result<(), Box<dyn std::error::Error>> {
println!("Comment:\n{}", comment);
}
let has_zip64 = archive.entries().any(|entry| entry.inner.is_zip64);
println!("{}", if has_zip64 { "Zip64" } else { "Zip32" });
if has_zip64 {
println!("Found Zip64 end of central directory locator")
}

let mut creator_versions = HashSet::<rc_zip::Version>::new();
let mut reader_versions = HashSet::<rc_zip::Version>::new();
Expand Down
3 changes: 3 additions & 0 deletions crates/rc-zip/src/format/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,9 @@ pub enum Method {
/// [DEFLATE (RFC 1951)](https://www.ietf.org/rfc/rfc1951.txt)
Deflate = 8,

/// [DEFLATE64](
Deflate64 = 9,

/// [BZIP-2](https://github.com/dsnet/compress/blob/master/doc/bzip2-format.pdf)
Bzip2 = 12,

Expand Down
1 change: 0 additions & 1 deletion crates/rc-zip/src/format/directory_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ impl DirectoryHeader {
needs_uncompressed_size: self.uncompressed_size == !0u32,
needs_header_offset: self.header_offset == !0u32,
};
trace!("extra field settings: {:#?}", settings);

let mut slice = &self.extra.0[..];
while !slice.is_empty() {
Expand Down
Binary file added crates/rc-zip/testdata/test-zips/found-me-bzip2.zip
Binary file not shown.
Binary file not shown.
Binary file added crates/rc-zip/testdata/test-zips/found-me-lzma.zip
Binary file not shown.

0 comments on commit 295cb65

Please sign in to comment.