From 14b5f8ab993057a60e86a1da9449d5b6c1c5eadf Mon Sep 17 00:00:00 2001 From: Danilo Del Busso Date: Mon, 18 Sep 2023 08:59:56 +0100 Subject: [PATCH] Ensure relative path name removes `rootPath` Signed-off-by: Danilo Del Busso --- XenCenterLib/Archive/ArchiveWriter.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/XenCenterLib/Archive/ArchiveWriter.cs b/XenCenterLib/Archive/ArchiveWriter.cs index 20d34fa53..3146d563f 100644 --- a/XenCenterLib/Archive/ArchiveWriter.cs +++ b/XenCenterLib/Archive/ArchiveWriter.cs @@ -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('/'); }