Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Issue #337 and Partially Fix #338 #392

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 4 additions & 8 deletions src/ICSharpCode.SharpZipLib/Tar/TarEntry.cs
Expand Up @@ -379,10 +379,14 @@ public void GetFileTarHeader(TarHeader header, string file)
string name = file;

// 23-Jan-2004 GnuTar allows device names in path where the name is not local to the current directory
// 04-Apr-2019 Removed this block, as it creates different behavior based the location of the executing
// assembly.
/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purpose of this block is to do exactly that. While I do agree that this may not belong here, just removing it will just break code relying on this behaviour.

if (name.IndexOf(Directory.GetCurrentDirectory(), StringComparison.Ordinal) == 0)
{
name = name.Substring(Directory.GetCurrentDirectory().Length);
}
*/

/*
if (Path.DirectorySeparatorChar == '\\')
Expand All @@ -404,14 +408,6 @@ public void GetFileTarHeader(TarHeader header, string file)

name = name.Replace(Path.DirectorySeparatorChar, '/');

// No absolute pathnames
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a viable solution.

// Windows (and Posix?) paths can start with UNC style "\\NetworkDrive\",
// so we loop on starting /'s.
while (name.StartsWith("/", StringComparison.Ordinal))
{
name = name.Substring(1);
}

header.LinkName = String.Empty;
header.Name = name;

Expand Down