SharpZipLib
SharpZipLib copied to clipboard
ZipFile allows duplicate entries to be added, but not updated
Steps to reproduce
- Create a new archive with at least two entry with same name
- 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
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?