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

Revert "path: resolve normalize drive letter to lower case" #100

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions lib/path.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,6 @@ win32.resolve = function() {
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) ||
'.';
};
Expand Down
5 changes: 2 additions & 3 deletions test/simple/test-module-nodemodulepaths.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

var common = require('../common');
var assert = require('assert');
var path = require('path');

var module = require('module');

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

if (isWindows) {
file = path.normalize('C:\\Users\\Rocko Artischocko\\node_stuff\\foo');
file = 'C:\\Users\\Rocko Artischocko\\node_stuff\\foo';
delimiter = '\\'
} else {
file = '/usr/test/lib/node_modules/npm/foo';
Expand All @@ -40,4 +39,4 @@ if (isWindows) {
paths = module._nodeModulePaths(file);

assert.ok(paths.indexOf(file + delimiter + 'node_modules') !== -1);
assert.ok(Array.isArray(paths));
assert.ok(Array.isArray(paths));
2 changes: 1 addition & 1 deletion test/simple/test-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ if (isWindows) {
[['c:/ignore', 'd:\\a/b\\c/d', '\\e.exe'], 'd:\\e.exe'],
[['c:/ignore', 'c:/some/file'], 'c:\\some\\file'],
[['d:/ignore', 'd:some/dir//'], 'd:\\ignore\\some\\dir'],
[['.'], path.normalize(process.cwd())],
[['.'], process.cwd()],
[['//server/share', '..', 'relative\\'], '\\\\server\\share\\relative'],
[['c:/', '//'], 'c:\\'],
[['c:/', '//dir'], 'c:\\dir'],
Expand Down