Skip to content

Don't add Zip64 fields when copying entries unless the source entry has them#128

Merged
mrkkrp merged 2 commits intomrkkrp:masterfrom
quytelda:zip64
Jun 2, 2025
Merged

Don't add Zip64 fields when copying entries unless the source entry has them#128
mrkkrp merged 2 commits intomrkkrp:masterfrom
quytelda:zip64

Conversation

@quytelda
Copy link
Copy Markdown
Contributor

This is an continuation of my last MR (#127).

I discovered that the unwanted Zip64 extra fields (from issue #126) get reintroduced when copying files from another archive (and hence when commit is used between actions). Thankfully, the fix is straightforward - we should be able to rule out the need for Zip64 extra fields if the source entry being copied doesn't use them, since this implies the uncompressed size is sufficiently small. I also added a test which reflects this behavior.

quytelda added 2 commits May 30, 2025 23:50
When copying an entry from another archive, there is no reason to add
Zip64 extra fields if the source entry doesn't have them. This change
checks whether a copied entry had Zip64 extra fields before
appending/updating the field in the local header.
Add two tests to ensure addEntry and copyEntry don't add unneeded
Zip64 extra fields into the local file header.
@mrkkrp mrkkrp merged commit 1d44d56 into mrkkrp:master Jun 2, 2025
4 checks passed
@mrkkrp
Copy link
Copy Markdown
Owner

mrkkrp commented Jun 2, 2025

This looks good, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants