Skip to content

Commit

Permalink
Ensure relative path name removes rootPath
Browse files Browse the repository at this point in the history
Signed-off-by: Danilo Del Busso <[email protected]>
  • Loading branch information
danilo-delbusso committed Sep 18, 2023
1 parent 73743a3 commit 14b5f8a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion XenCenterLib/Archive/ArchiveWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,10 @@ public void Dispose()

private string CleanRelativePathName(string rootPath, string pathName)
{
var cleanedRootPath = rootPath.Replace(@"\\?\", string.Empty);
return pathName
.Replace(@"\\?\", string.Empty)
.Replace(rootPath, string.Empty)
.Replace(cleanedRootPath, string.Empty)
.Replace('\\', '/')
.TrimStart('/');
}
Expand Down

0 comments on commit 14b5f8a

Please sign in to comment.