Skip to content

Changes to populate ZipArchive.ZipVolumne.Comment - #436

Merged
adamhathcock merged 2 commits into
adamhathcock:masterfrom
Numpsy:populate_zip_volume_comment
Jan 14, 2019
Merged

Changes to populate ZipArchive.ZipVolumne.Comment#436
adamhathcock merged 2 commits into
adamhathcock:masterfrom
Numpsy:populate_zip_volume_comment

Conversation

@Numpsy

@Numpsy Numpsy commented Jan 13, 2019

Copy link
Copy Markdown
Contributor

(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.)

@adamhathcock

Copy link
Copy Markdown
Owner

Thanks for this.

I fully admit my code paths aren't 100% as I came at this from a "can I make the entire process non-seeking?" vs being feature complete.

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