Skip to content
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

Refactor repeated invalid character checks in Path.GetFullPath Unix and Windows #56568

Merged
merged 5 commits into from
Aug 6, 2021

Conversation

steveberdy
Copy link
Contributor

@steveberdy steveberdy commented Jul 29, 2021

Summary

There were repeated, expensive checks on paths in the Path.GetFullPath method. This has been refactored with a GetFullPathInternal method that contains the shared code between the methods. These repetitions were found on both the Windows and Unix sides, and thus implementations of the GetFullPathInternal method were written for both.

Intended to extend PR #55373

Fixes #54993

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Jul 29, 2021
@ghost
Copy link

ghost commented Jul 29, 2021

Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.

Issue Details

Summary

Where paths were checked to not be null, empty, or otherwise invalid, calls to Path.GetFullPath() were replaced with Path.GetFullyQualifiedPath(). A Unix implementation of GetFullyQualifiedPath was included as well.

Fixes #54993

Author: steveberdy
Assignees: -
Labels:

area-System.IO

Milestone: -

@stephentoub stephentoub added the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Jul 30, 2021
@steveberdy steveberdy changed the title Replace qualified instances of Path.GetFullPath with Path.GetFullyQualifiedPath Replace non-empty path calls from Path.GetFullPath with Path.GetFullNonEmptyPath Jul 31, 2021
@steveberdy steveberdy reopened this Aug 2, 2021
@steveberdy steveberdy changed the title Replace non-empty path calls from Path.GetFullPath with Path.GetFullNonEmptyPath Refactored repeated invalid character checks in Path.GetFullPath Aug 2, 2021
@steveberdy steveberdy changed the title Refactored repeated invalid character checks in Path.GetFullPath Refactor repeated invalid character checks in Path.GetFullPath Unix and Windows Aug 2, 2021
@jeffhandley
Copy link
Member

/azp run runtime

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@steveberdy steveberdy requested review from jkotas and stephentoub and removed request for jkotas August 3, 2021 13:25
Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!

@jkotas
Copy link
Member

jkotas commented Aug 5, 2021

@stephentoub Looks good?

Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks.

@stephentoub stephentoub closed this Aug 5, 2021
@stephentoub stephentoub reopened this Aug 5, 2021
@stephentoub
Copy link
Member

/azp run

@azure-pipelines
Copy link

You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list.

@stephentoub
Copy link
Member

/azp list

@steveberdy
Copy link
Contributor Author

Good to merge?

@stephentoub
Copy link
Member

System.Net.Security test failure is unrelated.

@stephentoub stephentoub merged commit 58efa4b into dotnet:main Aug 6, 2021
@steveberdy steveberdy deleted the sb-54993 branch August 6, 2021 16:59
@adamsitnik adamsitnik removed the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Aug 11, 2021
@adamsitnik adamsitnik added this to the 6.0.0 milestone Aug 11, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Sep 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.IO community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicated path.Contains('\0') check
5 participants