Imported Upstream version 4.4.2.4

Former-commit-id: 92904c9c5915c37244316e42ba99e7b934ed7ee2
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2016-07-21 09:40:10 +00:00
parent 589d484eee
commit 0b4a830db1
343 changed files with 9849 additions and 688 deletions

View File

@ -82,10 +82,14 @@ namespace SharpCompress.Archive
{
key = key.Substring(1);
}
// .NET allows duplicate entries when saving and loading Zip files.
// The following lines are disabled from upstream SharpCompress to allow this.
#if ZIP_ALLOW_DUPLICATE_KEYS
if (DoesKeyMatchExisting(key))
{
throw new ArchiveException("Cannot add entry with duplicate key: " + key);
}
#endif
var entry = CreateEntry(key, source, size, modified, closeStream);
newEntries.Add(entry);
RebuildModifiedCollection();
@ -101,7 +105,8 @@ namespace SharpCompress.Archive
{
p = p.Substring(1);
}
return string.Equals(p, key, StringComparison.OrdinalIgnoreCase);
if (string.Equals(p, key, StringComparison.OrdinalIgnoreCase))
return true;
}
return false;
}