diff options
author | dead-horse <dead_horse@qq.com> | 2014-09-17 14:59:59 +0400 |
---|---|---|
committer | Alexis Campailla <alexis@janeasystems.com> | 2014-10-20 22:48:00 +0400 |
commit | f6e574018090ed4d63596b8a3bb614f8f48b6267 (patch) | |
tree | 34d6f54f27574ce99e7b7ebe4b2137a9895c301b /lib/path.js | |
parent | d22637c36c0749baaf50e05fea010fbc3a698a74 (diff) |
path: resolve normalize drive letter to lower case
make path.resolve work the same as path.normalize
Diffstat (limited to 'lib/path.js')
-rw-r--r-- | lib/path.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/path.js b/lib/path.js index 44ef0d68e25..fc5e650ce72 100644 --- a/lib/path.js +++ b/lib/path.js @@ -163,6 +163,11 @@ if (isWindows) { resolvedTail = normalizeArray(resolvedTail.split(/[\\\/]+/).filter(f), !resolvedAbsolute).join('\\'); + // If device is a drive letter, we'll normalize to lower case. + if (resolvedDevice && resolvedDevice.charAt(1) === ':') + resolvedDevice = resolvedDevice[0].toLowerCase() + + resolvedDevice.substr(1); + return (resolvedDevice + (resolvedAbsolute ? '\\' : '') + resolvedTail) || '.'; }; |