Merge pull request #136 from zentron/master

Fix for `System.IO.Compression` created empty directory in zip
This commit is contained in:
Adam Hathcock
2016-03-03 13:13:59 +00:00

View File

@@ -16,7 +16,17 @@ namespace SharpCompress.Common.Zip.Headers
internal bool IsDirectory
{
get { return Name.EndsWith("/"); }
get
{
if (Name.EndsWith("/"))
return true;
//.NET Framework 4.5 : System.IO.Compression::CreateFromDirectory() probably writes backslashes to headers
return CompressedSize == 0
&& UncompressedSize == 0
&& Name.EndsWith("\\");
}
}
protected string DecodeString(byte[] str)