From b0b62fcf919e147056ffe575b414b4917c3bfb8c Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Fri, 12 Aug 2016 12:14:22 +0100 Subject: [PATCH] Try to fix frameworks again by matching JSON.NET --- .../Compressor/Deflate/GZipStream.cs | 16 ++++++++-- src/SharpCompress/project.json | 30 ++++--------------- 2 files changed, 19 insertions(+), 27 deletions(-) diff --git a/src/SharpCompress/Compressor/Deflate/GZipStream.cs b/src/SharpCompress/Compressor/Deflate/GZipStream.cs index d884d490..97cf548a 100644 --- a/src/SharpCompress/Compressor/Deflate/GZipStream.cs +++ b/src/SharpCompress/Compressor/Deflate/GZipStream.cs @@ -355,7 +355,7 @@ namespace SharpCompress.Compressor.Deflate } } - public String FileName + public string FileName { get { return fileName; } set @@ -372,10 +372,20 @@ namespace SharpCompress.Compressor.Deflate if (fileName.EndsWith("\\")) throw new InvalidOperationException("Illegal filename"); - if (fileName.IndexOf("\\") != -1) + var index = fileName.IndexOf("\\"); + if (index != -1) { // trim any leading path - fileName = Path.GetFileName(fileName); + int length = fileName.Length; + int num = length; + while (--num >= 0) + { + char c = fileName[num]; + if (c == '\\') + { + fileName = fileName.Substring(num + 1, length - num - 1); + } + } } } } diff --git a/src/SharpCompress/project.json b/src/SharpCompress/project.json index 160112cf..32b4e054 100644 --- a/src/SharpCompress/project.json +++ b/src/SharpCompress/project.json @@ -1,5 +1,5 @@ { - "version": "0.12.3", + "version": "0.12.4", "title": "SharpCompress - Pure C# Decompression/Compression", "authors": [ "Adam Hathcock" ], "language": "en-US", @@ -11,29 +11,19 @@ "description": "SharpCompress is a compression library for .NET/Mono/Silverlight/WP7/WindowsStore that can unrar, decompress 7zip, zip/unzip, tar/untar bzip2/unbzip2 and gzip/ungzip with forward-only reading and file random access APIs. Write support for zip/tar/bzip2/gzip is implemented.", "requireLicenseAcceptance": false }, + "buildOptions": { + "warningsAsErrors": true, + "allowUnsafe": true + }, "frameworks": { "net35": { - "buildOptions": { - "warningsAsErrors": true, - "allowUnsafe": true - } }, "net40": { - "buildOptions": { - "warningsAsErrors": true, - "allowUnsafe": true - } }, "net45": { - "buildOptions": { - "warningsAsErrors": true, - "allowUnsafe": true - } }, - "sl5": { + ".NETPortable,Version=v4.0,Profile=Profile328": { "buildOptions": { - "warningsAsErrors": true, - "allowUnsafe": true, "define": [ "NO_FILE", "NO_CRYPTO", "SILVERLIGHT" ] }, "frameworkAssemblies": { @@ -44,8 +34,6 @@ }, ".NETPortable,Version=v4.5,Profile=Profile259": { "buildOptions": { - "warningsAsErrors": true, - "allowUnsafe": true, "define": [ "NO_FILE", "NO_CRYPTO", "SILVERLIGHT" ] }, "frameworkAssemblies": { @@ -64,8 +52,6 @@ }, "netstandard1.0": { "buildOptions": { - "warningsAsErrors": true, - "allowUnsafe": true, "define": [ "NO_FILE", "NO_CRYPTO" ] }, "dependencies": { @@ -79,10 +65,6 @@ } }, "netstandard1.3": { - "buildOptions": { - "warningsAsErrors": true, - "allowUnsafe": true - }, "dependencies": { "System.Collections": "4.0.11", "System.Diagnostics.Debug": "4.0.11",