-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible for a Windows drive to have more than one letter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not as far as I know and I expect that would break assumptions elsewhere if it could.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jozkee thank you!
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.