Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

@maryamariyan
Copy link

@maryamariyan maryamariyan commented Feb 9, 2018

Fixes: dotnet/corefx#26359

Will create the corefx PR updating System.Runtime.Extensions shortly.
FYI, WIP: https://github.com/maryamariyan/corefx/pull/21/files

if (PathInternal.HasWildCardCharacters(fullPath))
throw new ArgumentException(SR.Argument_InvalidPathChars, nameof(path));
}
string fullPath = PathHelper.Normalize(path, checkInvalidCharacters: false, expandShortPaths: true);
Copy link
Member

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?

Copy link
Member

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;
Copy link
Member

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.

@maryamariyan
Copy link
Author

I haven't finished updating all the tests that will fail by this change yet.
So far System.Runtime.Extensions and System.IO.FileSystem are affected by this.
Will add a comment here once that is done.

JeremyKuhne added a commit to JeremyKuhne/coreclr that referenced this pull request Feb 20, 2018
Remove other usages of PathSkip (related to dotnet#16311)
JeremyKuhne added a commit that referenced this pull request Feb 21, 2018
* 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)
@JeremyKuhne
Copy link
Member

I've included @maryamariyan's changes in #16478. (Thanks @maryamariyan!) Closing this one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants