Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 4d06437

Browse files
Anipikahsonkhan
authored andcommitted
Bug in GetFullPath(basePath, Path) (dotnet/coreclr#16598)
* GetFullPath and GetRootLength Corrected * Removed getpathroot * using span * "\\" changed to @"\" Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
1 parent 5798761 commit 4d06437

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Common/src/CoreLib/System/IO/Path.Windows.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ public static string GetFullPath(string path, string basePath)
9898
{
9999
// No matching root, root to specified drive
100100
// "D:Foo" and "C:\Bar" => "D:Foo"
101-
// "D:\Foo" and "\\?\C:\Bar" => "\\?\D:\Foo"
102-
combinedPath = path.Insert(2, "\\");
101+
// "D:Foo" and "\\?\C:\Bar" => "\\?\D:\Foo"
102+
combinedPath = PathInternal.IsDevice(basePath) ? CombineNoChecksInternal(basePath.AsSpan().Slice(0, 4), path.AsSpan().Slice(0, 2), @"\", path.AsSpan().Slice(2)) : path.Insert(2, "\\");
103103
}
104104
}
105105
else

0 commit comments

Comments
 (0)