mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
[PR #929] [MERGED] Fix zipentry comment implementation #1351
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/adamhathcock/sharpcompress/pull/929
Author: @Morilli
Created: 7/19/2025
Status: ✅ Merged
Merged: 7/22/2025
Merged by: @adamhathcock
Base:
master← Head:fix-zipentry-comment📝 Commits (2)
d78a682add failing test4e7baebfix zipentry comment being lost after reading local entry header📊 Changes
8 files changed (+23 additions, -12 deletions)
View changed files
📝
src/SharpCompress/Archives/Zip/ZipArchiveEntry.cs(+0 -2)📝
src/SharpCompress/Common/Zip/Headers/DirectoryEntryHeader.cs(+0 -2)📝
src/SharpCompress/Common/Zip/Headers/ZipFileEntry.cs(+2 -0)📝
src/SharpCompress/Common/Zip/SeekableZipFilePart.cs(+2 -8)📝
src/SharpCompress/Common/Zip/SeekableZipHeaderFactory.cs(+5 -0)📝
src/SharpCompress/Common/Zip/ZipEntry.cs(+2 -0)📝
tests/SharpCompress.Test/Zip/ZipArchiveTests.cs(+12 -0)➕
tests/TestArchives/Archives/Zip.EntryComment.zip(+0 -0)📄 Description
The
Commentfield was only present the directory entry header, not the local entry header. This makes some sense as the local entry header does not have a comment in the zip file, but due to the way the local entry header was loaded (replacing the directory entry header with the local entry header) this caused the code expecting a directory entry header to fail once that happened.I've decided to just put the
Commentfield on the underlyingZipFileEntryclass and copy the value from the directory entry header to the local entry header.See the added test for how this failed.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.