Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to populate ZipArchive.ZipVolumne.Comment #436

Merged
merged 2 commits into from
Jan 14, 2019
Merged

Changes to populate ZipArchive.ZipVolumne.Comment #436

merged 2 commits into from
Jan 14, 2019

Conversation

Numpsy
Copy link
Contributor

@Numpsy Numpsy commented Jan 13, 2019

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

@adamhathcock adamhathcock merged commit e5c111f into adamhathcock:master Jan 14, 2019
@Numpsy Numpsy deleted the populate_zip_volume_comment branch January 14, 2019 10:01
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