Skip to content

Commit

Permalink
Merge pull request #238 from adamhathcock/issue_201
Browse files Browse the repository at this point in the history
Normalize Rar keys
  • Loading branch information
adamhathcock authored May 23, 2017
2 parents 7b81d18 + 4d0c509 commit 18641d4
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions src/SharpCompress/Common/Rar/Headers/FileHeader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,25 +165,13 @@ private static string ConvertPath(string path, HostOS os)
#if NO_FILE
return path.Replace('\\', '/');
#else
switch (os)
if (Path.DirectorySeparatorChar == '/')
{
case HostOS.MacOS:
case HostOS.Unix:
{
if (Path.DirectorySeparatorChar == '\\')
{
return path.Replace('/', '\\');
}
}
break;
default:
{
if (Path.DirectorySeparatorChar == '/')
{
return path.Replace('\\', '/');
}
}
break;
return path.Replace('\\', '/');
}
else if (Path.DirectorySeparatorChar == '\\')
{
return path.Replace('/', '\\');
}
return path;
#endif
Expand Down

0 comments on commit 18641d4

Please sign in to comment.