Merge commit '18641d4f9b849daea7b6fbb7edad51369534ffa3'

* commit '18641d4f9b849daea7b6fbb7edad51369534ffa3':
  Normalize Rar keys
This commit is contained in:
Adam Hathcock
2017-05-23 16:15:58 +01:00

View File

@@ -165,25 +165,13 @@ namespace SharpCompress.Common.Rar.Headers
#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