[PR #436] [MERGED] Changes to populate ZipArchive.ZipVolumne.Comment #1027

Closed
opened 2026-01-29 22:18:42 +00:00 by claunia · 0 comments
Owner

📋 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: masterHead: populate_zip_volume_comment


📝 Commits (2)

  • 12a6d39 Return the DirectoryEndHeader from SeekableZipHeaderFactory.ReadSeekable so that it can be used by ZipArchive
  • 4e9cd06 Unit 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.

## 📋 Pull Request Information **Original PR:** https://github.com/adamhathcock/sharpcompress/pull/436 **Author:** [@Numpsy](https://github.com/Numpsy) **Created:** 1/13/2019 **Status:** ✅ Merged **Merged:** 1/14/2019 **Merged by:** [@adamhathcock](https://github.com/adamhathcock) **Base:** `master` ← **Head:** `populate_zip_volume_comment` --- ### 📝 Commits (2) - [`12a6d39`](https://github.com/adamhathcock/sharpcompress/commit/12a6d3977e548c3ccdf280ec6a88215552819e25) Return the DirectoryEndHeader from SeekableZipHeaderFactory.ReadSeekable so that it can be used by ZipArchive - [`4e9cd06`](https://github.com/adamhathcock/sharpcompress/commit/4e9cd064dd120354eab19c031554ae5e40969a29) Unit test to show reading of a Zip volume/archive comment ### 📊 Changes **2 files changed** (+30 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `src/SharpCompress/Common/Zip/SeekableZipHeaderFactory.cs` (+14 -8) 📝 `tests/SharpCompress.Test/Zip/ZipArchiveTests.cs` (+16 -0) </details> ### 📄 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.) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 22:18:42 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#1027