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

Fallback to process cwd when resolving drive cwd #8541

Closed
wants to merge 2 commits into from

Commits on Sep 15, 2016

  1. Fallback to process cwd when resolving drive cwd

    The `path.resolve()` function when given just a drive letter such as
    "C:" tries to get a drive-specific CWD, but that isn't available in
    cases when the process is not launched via cmd.exe and the process
    CWD has not been explicitly set on that drive.
    
    This change adds a fallback to the process CWD, if the process CWD
    happens to be on the resolved drive letter. If the process CWD is on
    another drive, then a drive-specific CWD cannot be resolved and
    defaults to the drive's root as before.
    
    Based on experimentation, the fixed behavior matches that of other
    similar path resolution implementations on Windows I checked: .NET's
    `System.IO.Path.GetFullPath()` and Python's `os.path.abspath()`.
    
    In the automated path test cases the issue doesn't occur when the
    tests are run normally from cmd.exe. But it did cause an assertion
    when running the tests from PowerShell, that is fixed by this change.
    
    Fixes: nodejs#7215
    jasongin committed Sep 15, 2016
    Configuration menu
    Copy the full SHA
    537728d View commit details
    Browse the repository at this point in the history
  2. Test for resolve drive path

    jasongin committed Sep 15, 2016
    Configuration menu
    Copy the full SHA
    6413e1e View commit details
    Browse the repository at this point in the history