mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
[PR #436] [MERGED] Changes to populate ZipArchive.ZipVolumne.Comment #1027
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/436
Author: @Numpsy
Created: 1/13/2019
Status: ✅ Merged
Merged: 1/14/2019
Merged by: @adamhathcock
Base:
master← Head:populate_zip_volume_comment📝 Commits (2)
12a6d39Return the DirectoryEndHeader from SeekableZipHeaderFactory.ReadSeekable so that it can be used by ZipArchive4e9cd06Unit test to show reading of a Zip volume/archive comment📊 Changes
2 files changed (+30 additions, -8 deletions)
View changed files
📝
src/SharpCompress/Common/Zip/SeekableZipHeaderFactory.cs(+14 -8)📝
tests/SharpCompress.Test/Zip/ZipArchiveTests.cs(+16 -0)📄 Description
(Related to #290)
Looking at the code, it looks to me like ZipArchive.LoadEntries already contains support for populating the ZipVolume Comment field from the DirectoryEndHeader, but that doesn't get hit because SeekableZipHeaderFactory.ReadSeekableHeader never seems to return the DirectoryEndHeader, it just breaks when there are no more DirectoryEntryHeaders.
This change changes ReadSeekableHeader to return the DirectoryEndHeader, such that the volume comment is populated.
(i'm trying to work out how this stuff works as i go along, and i'm not quite sure how all the cases for returning/breaking in ReadSeekableHeader should ne handled, but the test case suggests that the simple case of getting the archive header works.)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.