icsharpcode / SharpZipLib

#ziplib is a Zip, GZip, Tar and BZip2 library written entirely in C# for the .NET platform.
http://icsharpcode.github.io/SharpZipLib/
MIT License
3.7k stars 976 forks source link

fix(zip): avoid throwing on empty file name #828

Closed piksel closed 1 year ago

piksel commented 1 year ago

Since the APPNOTE allows for zip files to contain files without a file name (useful for piping into a zip file), this ought to be allowed for SharpZipLib as well. This will fix the issue by handling a null value being returned by Path.GetPathRoot.

Supersedes #687.

I certify that I own, and have sufficient rights to contribute, all source code and related material intended to be compiled or integrated with the source code for the SharpZipLib open source product (the "Contribution"). My Contribution is licensed under the MIT License.