Skip to content

Commit 118750b

Browse files
committed
Fix issue icsharpcode#334 from icsharpcode/SharpZipLib
Ensures that, if the root path is an empty string, the library will not try to take a substring of the file name (and causing the first character to be truncated).
1 parent afcccb0 commit 118750b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ICSharpCode.SharpZipLib/Tar/TarArchive.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ private void WriteEntryCore(TarEntry sourceEntry, bool recurse)
784784

785785
string newName = null;
786786

787-
if (rootPath != null)
787+
if (!String.IsNullOrEmpty(rootPath))
788788
{
789789
if (entry.Name.StartsWith(rootPath, StringComparison.OrdinalIgnoreCase))
790790
{

0 commit comments

Comments
 (0)