Skip to content

Commit

Permalink
Bug in GetFullPath(basePath, Path) (dotnet#16598)
Browse files Browse the repository at this point in the history
* GetFullPath and GetRootLength Corrected

* Removed getpathroot

* using span

* "\\" changed to @"\"
  • Loading branch information
Anipik authored and A-And committed Feb 28, 2018
1 parent a3aa841 commit 686efaf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mscorlib/shared/System/IO/Path.Windows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 686efaf

Please sign in to comment.