Skip to content

Conversation

@carlossanlop
Copy link
Contributor

Fixes #35260

The first element in the condition of the conditional operator was wrong: We should return null if the passed path is effectively empty. I made sure the structure looked just like in the other method overload, to avoid confusion.

I added one unit test to verify the particular case in which I found the bug. In my PR for redundant segments I will be adding many more since GetPathRoot is used by the new API.

@ghost
Copy link

ghost commented May 2, 2020

Tagging subscribers to this area: @jozkee
Notify danmosemsft if you want to be subscribed.

@carlossanlop carlossanlop requested review from jkotas and jozkee May 2, 2020 00:49
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.

The product fix looks good. I agree with Jan about fixing the test.

@carlossanlop carlossanlop merged commit 61c6581 into dotnet:master May 13, 2020
@carlossanlop carlossanlop deleted the FixGetPathRoot branch May 13, 2020 19:24
@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Different output in Unix between Path.GetPathRoot overloads for redundant segments

4 participants