Skip to content

Commit

Permalink
Merge pull request #222 from pjf/221_ziplib
Browse files Browse the repository at this point in the history
Bugfix to SharpZipLib.
  • Loading branch information
pjf committed Oct 31, 2014
2 parents 2a6f5a4 + 8449b1b commit b9249ff
Show file tree
Hide file tree
Showing 13 changed files with 9,542 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CKAN/CKAN/CKAN.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<HintPath>..\packages\Newtonsoft.Json.6.0.5\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib">
<HintPath>..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll</HintPath>
<HintPath>..\packages\SharpZipLib.0.86.0-pjf-ckan_gh221\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
<Reference Include="log4net">
<HintPath>..\packages\log4net.2.0.3\lib\net40-full\log4net.dll</HintPath>
Expand Down
2 changes: 1 addition & 1 deletion CKAN/NetKAN/NetKAN.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="ICSharpCode.SharpZipLib">
<HintPath>..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll</HintPath>
<HintPath>..\packages\SharpZipLib.0.86.0-pjf-ckan_gh221\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="Newtonsoft.Json">
Expand Down
3 changes: 2 additions & 1 deletion CKAN/Tests/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<HintPath>..\packages\Newtonsoft.Json.6.0.5\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib">
<HintPath>..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll</HintPath>
<HintPath>..\packages\SharpZipLib.0.86.0-pjf-ckan_gh221\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
<Reference Include="System.Transactions" />
</ItemGroup>
Expand All @@ -56,6 +56,7 @@
<Compile Include="NetKAN\KSMod.cs" />
<Compile Include="NetKAN\GitHubTests.cs" />
<Compile Include="CKAN\ModuleInstallDescriptor.cs" />
<Compile Include="ZipLib.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
Expand Down
32 changes: 32 additions & 0 deletions CKAN/Tests/ZipLib.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using NUnit.Framework;
using ICSharpCode.SharpZipLib.Zip;
using System.IO;
using System;

namespace Tests
{
[TestFixture()]
public class ZipLib
{
[Test()]
public void GH221()
{
// This is a perfectly fine file, written by 'file-roller', but
// SharpZipLib can choke on it because it's not properly handling
// the headers properly. See GH #221.
string file = Path.Combine(TestData.DataDir(), "gh221.zip");

var zipfile = new ZipFile(file);

var entry = zipfile.GetEntry("221.txt");

string version = string.Format("{0}", entry.Version);

Assert.DoesNotThrow(delegate
{
zipfile.GetInputStream(entry);
}, "zip-entry format {0} (788 is our bug)", version);
}
}
}

Binary file not shown.
9,498 changes: 9,498 additions & 0 deletions CKAN/packages/SharpZipLib.0.86.0-pjf-ckan_gh221/ICSharpCode.SharpZipLib.xml

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions CKAN/packages/SharpZipLib.0.86.0-pjf-ckan_gh221/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
This is a patched copy of ZSharpLib which fixes the
`ZipException: Version required to extract this entry not supported (788)`
bug described [here](http://community.sharpdevelop.net/forums/t/21758.aspx).

- Get [this branch](https://github.com/pjf/SharpZipLib/tree/ckan_gh221).
- `cd SharpZipLib/src`
- `xbuild /p:Configuration=Release ICSharpCode.SharpZLib.csproj`
- Copy the build artefacts from `../bin`.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added t/data/gh221.zip
Binary file not shown.

0 comments on commit b9249ff

Please sign in to comment.