Skip to content

path.relative method returns wrong path when UNC path is provided #8444

Description

@amatas

It seems that versions prior v6 are not affected.

  • Version: v6
  • Platform: windows
  • Subsystem: path

Tests:

  • Windows 10 with node 4.5.0:
  c:\>node -e "console.log(require('path').relative('.','\\\\VBOXSRV\\vagrant'))"

returns: \\VBOXSRV\vagrant\

  • Windows 10 with node 6.5.0:
  c:\>node -e "console.log(require('path').relative('.','\\\\VBOXSRV\\vagrant'))"

returns: VBOXSRV\vagrant\(the leading backslashes are missing)
expected: \\VBOXSRV\vagrant\

Related issue: nodejs/nan#601

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions