-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Removing the colon block that tosses out paths that are not device path. #16311
Conversation
| if (PathInternal.HasWildCardCharacters(fullPath)) | ||
| throw new ArgumentException(SR.Argument_InvalidPathChars, nameof(path)); | ||
| } | ||
| string fullPath = PathHelper.Normalize(path, checkInvalidCharacters: false, expandShortPaths: true); |
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.
PathHelper.Normalize seems to be always called with the same 2nd and 3rd argument. Strip these arguments?
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.
I'm ok with stripping them. I hope to eventually provide an option on the public API around expanding short paths. canonicalization of paths is the dream that would take care of it, but it is incredibly hard to design/implement.
| } | ||
| string fullPath = PathHelper.Normalize(path, checkInvalidCharacters: false, expandShortPaths: true); | ||
|
|
||
| return fullPath; |
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.
Nit: You can do direct return PathHelper.Normalize(.... No need to have local anymore.
|
I haven't finished updating all the tests that will fail by this change yet. |
8bac5e5 to
ecee6da
Compare
Remove other usages of PathSkip (related to dotnet#16311)
* Dial back aggressive checks in Path Aggressive checks are preventing crossplat and extended Windows solutions. This change: - Doesn't throw on empty paths fro GetDirectoryName, GetPathRoot - Doesn't consider colon when looking at path segments on Windows - Moves non-shared code out of PathInternal - Fix span GetDirectoryName to handle multiple separators * Comment updates * Check for valid drive letter with PathRoot Remove other usages of PathSkip (related to #16311)
|
I've included @maryamariyan's changes in #16478. (Thanks @maryamariyan!) Closing this one. |
Fixes: dotnet/corefx#26359
Will create the corefx PR updating System.Runtime.Extensions shortly.
FYI, WIP: https://github.com/maryamariyan/corefx/pull/21/files