Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordead-horse <dead_horse@qq.com>2014-09-17 14:59:59 +0400
committerAlexis Campailla <alexis@janeasystems.com>2014-10-20 22:48:00 +0400
commitf6e574018090ed4d63596b8a3bb614f8f48b6267 (patch)
tree34d6f54f27574ce99e7b7ebe4b2137a9895c301b /lib/path.js
parentd22637c36c0749baaf50e05fea010fbc3a698a74 (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.js5
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) ||
'.';
};