-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Path.GetFullPath(string, string) uses case insensitive volume name comparison for drive rooted, relative paths #97759
Merged
jozkee
merged 12 commits into
dotnet:main
from
AnakinRaW:caseinsensitive-driverelative-path
Mar 19, 2024
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
fe4d622
check root for drive relative paths case insensitive.
AnakinRaW c1d71cb
Merge branch 'dotnet:main' into caseinsensitive-driverelative-path
AnakinRaW 112a318
Merge branch 'main' into caseinsensitive-driverelative-path
AnakinRaW 20067da
Merge branch 'main' into caseinsensitive-driverelative-path
AnakinRaW 9007951
Merge branch 'main' into caseinsensitive-driverelative-path
AnakinRaW f926509
Merge branch 'main' into caseinsensitive-driverelative-path
AnakinRaW f03503a
Merge branch 'main' into caseinsensitive-driverelative-path
AnakinRaW 4dd5b29
Remove link
AnakinRaW 47cb32e
Merge branch 'main' into caseinsensitive-driverelative-path
AnakinRaW 0acd5ce
apply feedback
AnakinRaW a9b320f
Merge branch 'main' into caseinsensitive-driverelative-path
AnakinRaW 1d43a6b
Merge branch 'main' into caseinsensitive-driverelative-path
jozkee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
There are other places in this file where
EqualsOrdinal
is used, can you change those as well?runtime/src/libraries/System.Private.CoreLib/src/System/IO/Path.Windows.cs
Lines 349 to 353 in 7a60900
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.
sure. done that. However, I omitted
EqualsOrdinal(@"\\".AsSpan()
as there is nothing to compare case-insensitive. If it should be consistent though, i can chance again of course.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.
Are you sure this is correct for \\SERVER\SHARE as I think this is a valid volume name on Windows.
In that case the server name should be case insensitive, but the share name might not (Think non windows OSs like Samba on linux).
Testcases on these paths are usually hard, as this call might try contacting the server...
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.
GetVolumeName
is only used whenpath
is drive relative like C:foo, it's used to check whetherpath
andbasePath
have the same root, the method is probably more complex than it needs to but I don't think it would affect UNC paths.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.
Actually that was my thought when applying the changes :)