Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix ZipEntry name mismatch when attempting to update a directory entry #309

Closed
wants to merge 3 commits into from

Conversation

dotlive
Copy link

@dotlive dotlive commented Jan 21, 2019

I certify that I own, and have sufficient rights to contribute, all source code and related material intended to be compiled or integrated with the source code for the SharpZipLib open source product (the "Contribution"). My Contribution is licensed under the MIT License.

Copy link
Member

@piksel piksel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is FindExistingUpdate changed here?

@@ -1579,7 +1579,7 @@ private void AddUpdate(ZipUpdate update)
{
contentsEdited_ = true;

int index = FindExistingUpdate(update.Entry.Name);
int index = FindExistingUpdate(update.Entry);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is FindExistingUpdate changed here?

The FindExistingUpdate(ZipEntry) method should probably just call FindExistingUpdate(string) for DRYness, but that's for another issue...

@@ -2511,6 +2513,15 @@ private int FindExistingUpdate(string fileName)
return result;
}

private bool IsDirectoryName(string name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetTransformedFileName is only referenced in FindExistingUpdate, perhaps GetTransformedFileName, GetTransformedDirectoryName and IsDirectoryName should be reduced to a single function called GetTransformedEntryName? The two former ones are almost identical.

@piksel
Copy link
Member

piksel commented Dec 30, 2019

Closing due to lack of response.

@piksel piksel closed this Dec 30, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants