Do not Path.Join user directory if it's "C:"#94587
Conversation
|
Tagging subscribers to this area: @dotnet/area-system-io Issue DetailsFixes #68503 On netfx we were special-casing joining user directories ending with volume separator. That is not the case in .NET [core]. This change brings that back as it is incorrect to join paths like "C:" with a separator in between the enumerated entries as the meaning of "relative to drive's CWD" gets lost.
|
Add ConditionalFact for RemoteExecutor
|
Added When you commit this breaking change:
Tagging @dotnet/compat for awareness of the breaking change. |
adamsitnik
left a comment
There was a problem hiding this comment.
Overall it LGTM, I just need to make sure it's always a single letter. Thank you for fixing this bug @jozkee !
| ReadOnlySpan<char> relativePath, | ||
| ReadOnlySpan<char> fileName) | ||
| { | ||
| if (originalRootDirectory.Length == 2 && originalRootDirectory[1] == Path.VolumeSeparatorChar) |
There was a problem hiding this comment.
Is it possible for a Windows drive to have more than one letter?
There was a problem hiding this comment.
Not as far as I know and I expect that would break assumptions elsewhere if it could.
There was a problem hiding this comment.
When A-Z alphabets are all assigned, user either needs to switch to UNC paths via GUIDs \\?\Volume{GUID} to access the next device, or mount it as directory (via Disk management). That device would not show up in explorer by default.
|
CI errors are #95298. |
|
Breaking change doc. issue: dotnet/docs#39186 |
Fixes #68503
On netfx we were concatenating user directories ending with volume separator
:instead of joining with a path separator\. That is not the case in .NET [core]. This change brings that back as it is incorrect to join paths like "C:" with a separator in between the enumerated entries as the meaning of "relative to drive's CWD" gets lost.