Skip to content

Conversation

@mscdex
Copy link
Contributor

Pull Request check-list

  • Does make -j8 test (UNIX) or vcbuild test nosign (Windows) pass with
    this change (including linting)?
  • Is the commit message formatted according to CONTRIBUTING.md?
  • If this change fixes a bug (or a performance problem), is a regression
    test (or a benchmark) included?

Affected core subsystem(s)

  • path

Description of change

Fixes: #6027

@mscdexmscdex added windows Issues and PRs related to the Windows platform. path Issues and PRs related to the path subsystem. labels Apr 3, 2016
@mscdex
Copy link
ContributorAuthor

@benjamingr
Copy link
Member

Here are some relevant unit tests for checking if a path is absolute in win32

https://github.com/pmfsampaio/NETMF-LPC/blob/master/MicroFrameworkPK_v4_2/Test/Platform/Tests/CLR/System/IO/Path/IsPathRooted.cs

We should port some/all of them

}
}
}elseif(code===47/*/*/||code===92/*\*/){
if(code===47/*/*/||code===92/*\*/){
Copy link
Member

Choose a reason for hiding this comment

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

This code is much simpler than the old code - any idea why it was so long and what purpose the checks served?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I don't recall offhand, probably just a misinterpretation of the old regexp.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, the new version is correct on its own - the old one is just weird.

@mscdex
Copy link
ContributorAuthor

Here are some relevant unit tests for checking if a path is absolute in win32

https://github.com/pmfsampaio/NETMF-LPC/blob/master/MicroFrameworkPK_v4_2/Test/Platform/Tests/CLR/System/IO/Path/IsPathRooted.cs

We should port some/all of them

@benjamingr We already cover those more or less, especially so with the test case additions provided by this PR.

@benjamingr
Copy link
Member

Any particular reason the code between resolve and normalize is so duplicated?

Unrelated to this PR, but I want to know if there is a specific reason to it.

LGTM + asked for some clarifications.

@mscdex
Copy link
ContributorAuthor

@benjamingr I don't recall if it was performance reasons or what. If someone wants to try factoring that out and checking the performance differences, go for it :-). However I suspect that a helper function containing that factored out portion wouldn't be inlined (if for no reason other than code size), which would cause a performance regression to some degree.

@jasnell
Copy link
Member

@mscdex ... can you add a bit more explanation to the commit log? Otherwise LGTM

This commit fixes an inconsistency in absolute path checking compared to the absolute path detection used by the other path.win32 functions. Fixes: nodejs#6027 PR-URL: nodejs#6028
@mscdexmscdexforce-pushed the path-fix-win32-isabsolute branch from d35449c to 45a960eCompareApril 4, 2016 01:41
@mscdex
Copy link
ContributorAuthor

@jasnell Updated

@jasnell
Copy link
Member

Thanks! LGTM!

jasnell pushed a commit that referenced this pull request Apr 4, 2016
This commit fixes an inconsistency in absolute path checking compared to the absolute path detection used by the other path.win32 functions. Fixes: #6027 PR-URL: #6028 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]>
@jasnell
Copy link
Member

Landed in 3072546

@MylesBorins
Copy link
Contributor

@mscdex@jasnell should we back port the test?

edit: it currently passes fwiw

@mscdex
Copy link
ContributorAuthor

@thealphanerd AFAIK backporting the tests should be fine

@jasnell
Copy link
Member

+1 to backporting the tests

@mscdexmscdex deleted the path-fix-win32-isabsolute branch April 4, 2016 21:56
MylesBorins pushed a commit to MylesBorins/node that referenced this pull request Apr 4, 2016
Adds test cases to ensure win32.isAbsolute is consistent. This is a backport from 3072546 ref: nodejs#6028
MylesBorins pushed a commit that referenced this pull request Apr 5, 2016
This commit fixes an inconsistency in absolute path checking compared to the absolute path detection used by the other path.win32 functions. Fixes: #6027 PR-URL: #6028 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this pull request Apr 5, 2016
Notable changes: http: * Enclose IPv6 Host header in square brackets. This will enable proper seperation of the host adress from any port reference (Mihai Potra) #5314 path: * Make win32.isAbsolute more consistent (Brian White) #6028
This was referenced Apr 5, 2016
MylesBorins pushed a commit that referenced this pull request Apr 5, 2016
Notable changes: http: * Enclose IPv6 Host header in square brackets. This will enable proper seperation of the host adress from any port reference (Mihai Potra) #5314 path: * Make win32.isAbsolute more consistent (Brian White) #6028 PR-URL: #6060 Reviewed-By: Jeremiah Senkpiel <[email protected]>
MylesBorins pushed a commit that referenced this pull request Apr 5, 2016
Notable changes: http: * Enclose IPv6 Host header in square brackets. This will enable proper seperation of the host adress from any port reference (Mihai Potra) #5314 path: * Make win32.isAbsolute more consistent (Brian White) #6028 PR-URL: #6060 Reviewed-By: Jeremiah Senkpiel <[email protected]>
jasnell pushed a commit that referenced this pull request Apr 8, 2016
Adds test cases to ensure win32.isAbsolute is consistent. This is a backport from 3072546 Refs: #6028 PR-URL: #6043 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Brian White <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pathIssues and PRs related to the path subsystem.windowsIssues and PRs related to the Windows platform.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

path.isAbsolute wrong output

4 participants

@mscdex@benjamingr@jasnell@MylesBorins