Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Fix test-fs-realpath on Windows
Browse files Browse the repository at this point in the history
Also, in the process, fix a bug in fs.realpath on Windows.

If the user has permission to create symlinks, then use symlinks.  If
not, then skip over all the tests that cannot be run using Junctions
instead.
  • Loading branch information
isaacs committed Jun 14, 2012
1 parent 00247d5 commit 412c1ab
Show file tree
Hide file tree
Showing 2 changed files with 166 additions and 92 deletions.
6 changes: 5 additions & 1 deletion lib/fs.js
Expand Up @@ -941,7 +941,11 @@ var normalize = pathModule.normalize;

// Regexp that finds the next partion of a (partial) path
// result is [base_with_slash, base], e.g. ['somedir/', 'somedir']
var nextPartRe = /(.*?)(?:[\/]+|$)/g;
if (isWindows) {
var nextPartRe = /(.*?)(?:[\/\\]+|$)/g;
} else {
var nextPartRe = /(.*?)(?:[\/]+|$)/g;
}

// Regex to split a windows path into three parts: [*, device, slash,
// tail] windows-only
Expand Down

0 comments on commit 412c1ab

Please sign in to comment.