From 6a977e9be9af1c31f6bf017c7829fc5f02550525 Mon Sep 17 00:00:00 2001 From: Anirudh Agnihotry Date: Tue, 27 Feb 2018 15:56:23 -0800 Subject: [PATCH] Bug in GetFullPath(basePath, Path) (#16598) * GetFullPath and GetRootLength Corrected * Removed getpathroot * using span * "\\" changed to @"\" --- src/mscorlib/shared/System/IO/Path.Windows.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mscorlib/shared/System/IO/Path.Windows.cs b/src/mscorlib/shared/System/IO/Path.Windows.cs index 6a8745d12e26..c92211f73150 100644 --- a/src/mscorlib/shared/System/IO/Path.Windows.cs +++ b/src/mscorlib/shared/System/IO/Path.Windows.cs @@ -98,8 +98,8 @@ public static string GetFullPath(string path, string basePath) { // No matching root, root to specified drive // "D:Foo" and "C:\Bar" => "D:Foo" - // "D:\Foo" and "\\?\C:\Bar" => "\\?\D:\Foo" - combinedPath = path.Insert(2, "\\"); + // "D:Foo" and "\\?\C:\Bar" => "\\?\D:\Foo" + combinedPath = PathInternal.IsDevice(basePath) ? CombineNoChecksInternal(basePath.AsSpan().Slice(0, 4), path.AsSpan().Slice(0, 2), @"\", path.AsSpan().Slice(2)) : path.Insert(2, "\\"); } } else