Fix leading slash in ZIP archive#103
Merged
Merged
Conversation
GerardSmit
commented
Nov 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #102
Backward Compatibility
When you've created a ZIP archive with version <0.21, all entries will start with a
/in the entry name.To ensure we don't mismatch new entry names, I've introduced a new property:
When opening a ZIP archive from version <0.21 (or when there is a leading slash in the ZIP entry name), this property will be set to⚠️ (This is a breaking change)
true.For new ZIP file systems, it will be set to
false.When this property is set to
true, all new entries will have a leading slash.I've created two ZIPs (one before the change and one after the change) to validate that both the old and new ZIPs work correctly.
Recursive Rename/Deletion
While debugging, I found another bug.
When you have a directory name that starts with the same prefix as other directories in the same path, it would:
For example:
When you remove
dir\, it would also removedir-suffix\. This obviously shouldn't happen.Other Changes
Note: .NET Standard 2.1 is not being tested. .NET 8.0 and 9.0 have a direct match, and .NET 10.0 uses the .NET 9.0 library version.