Skip to content

Commit e24fa83

Browse files
seishunpiscisaureus
authored andcommitted
Revert "path: resolve normalize drive letter to lower case"
This reverts commit f6e5740. Changing drive letters to lowercase violates the principle of least surprise. Other functions that do this should get fixed too. Conflicts: lib/path.js PR-URL: #100 Reviewed-By: Bert Belder <[email protected]>
1 parent e3aa802 commit e24fa83

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

lib/path.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,6 @@ win32.resolve = function() {
162162
resolvedTail = normalizeArray(resolvedTail.split(/[\\\/]+/).filter(f),
163163
!resolvedAbsolute).join('\\');
164164

165-
// If device is a drive letter, we'll normalize to lower case.
166-
if (resolvedDevice && resolvedDevice.charAt(1) === ':') {
167-
resolvedDevice = resolvedDevice[0].toLowerCase() +
168-
resolvedDevice.substr(1);
169-
}
170-
171165
return (resolvedDevice + (resolvedAbsolute ? '\\' : '') + resolvedTail) ||
172166
'.';
173167
};

test/simple/test-module-nodemodulepaths.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
var common = require('../common');
2323
var assert = require('assert');
24-
var path = require('path');
2524

2625
var module = require('module');
2726

@@ -30,7 +29,7 @@ var isWindows = process.platform === 'win32';
3029
var file, delimiter, paths;
3130

3231
if (isWindows) {
33-
file = path.normalize('C:\\Users\\Rocko Artischocko\\node_stuff\\foo');
32+
file = 'C:\\Users\\Rocko Artischocko\\node_stuff\\foo';
3433
delimiter = '\\'
3534
} else {
3635
file = '/usr/test/lib/node_modules/npm/foo';
@@ -40,4 +39,4 @@ if (isWindows) {
4039
paths = module._nodeModulePaths(file);
4140

4241
assert.ok(paths.indexOf(file + delimiter + 'node_modules') !== -1);
43-
assert.ok(Array.isArray(paths));
42+
assert.ok(Array.isArray(paths));

test/simple/test-path.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ if (isWindows) {
311311
[['c:/ignore', 'd:\\a/b\\c/d', '\\e.exe'], 'd:\\e.exe'],
312312
[['c:/ignore', 'c:/some/file'], 'c:\\some\\file'],
313313
[['d:/ignore', 'd:some/dir//'], 'd:\\ignore\\some\\dir'],
314-
[['.'], path.normalize(process.cwd())],
314+
[['.'], process.cwd()],
315315
[['//server/share', '..', 'relative\\'], '\\\\server\\share\\relative'],
316316
[['c:/', '//'], 'c:\\'],
317317
[['c:/', '//dir'], 'c:\\dir'],

0 commit comments

Comments
 (0)