SharpZipLib icon indicating copy to clipboard operation
SharpZipLib copied to clipboard

ZipFile allows duplicate entries to be added, but not updated

Open ptittof57 opened this issue 6 years ago • 1 comments

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

ptittof57 avatar Apr 10 '19 12:04 ptittof57

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 avatar May 23 '19 20:05 piksel