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

ZipFile allows duplicate entries to be added, but not updated #335

Open
ptittof57 opened this issue Apr 10, 2019 · 1 comment
Open

ZipFile allows duplicate entries to be added, but not updated #335

ptittof57 opened this issue Apr 10, 2019 · 1 comment

Comments

@ptittof57
Copy link

Steps to reproduce

  1. Create a new archive with at least two entry with same name
  2. Try to call begin update

Expected behavior

I expect to update the file because I can create it with duplicate entry name.

Actual behavior

I can create with duplicate entry but can't update, it's seems this is an issue with ZipFile.cs - Row 1481

		updates_ = new List<ZipUpdate>(entries_.Length);
		foreach (ZipEntry entry in entries_)
		{
			int index = updates_.Count;
			updates_.Add(new ZipUpdate(entry));
			updateIndex_.Add(entry.Name, index);
		}

Version of SharpZipLib

1.1.0

Obtained from (only keep the relevant lines)

  • Package installed using NuGet
@piksel
Copy link
Member

piksel commented May 23, 2019

Ehm, why would you even want this? I'm not even sure what the bug is, shouldn't the library just prevent you from creating the duplicate in the first place?

@piksel piksel changed the title Can't Update Zip archive with duplicate entry name ZipFile allows duplicate entries to be added, but not updated Nov 10, 2020
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

No branches or pull requests

2 participants