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

The path string returned when nan is imported in node 6 is wrong in some cases #601

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Sep 7, 2016

  1. Use the absolute path instead of a relative path.

    The latest implementation of the path.relative function of node v6 seems
    to be broken when either of the "from" or "to" paths are in a network
    resource of windows, removing the leading backslashes "\\" and returning
    a wrong path [0].
    
    The new approach employs the path.resolve function that returns the
    absolute path to the nan headers and seems to work fine in the case of
    node v6 running in a windows box.
    
    Tests:
    
    * Windows 10 with node 4.3.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\
    
    [0] nodejs#600
    amatas committed Sep 7, 2016
    Configuration menu
    Copy the full SHA
    1bf8e0e View commit details
    Browse the repository at this point in the history