mirror of https://github.com/nodejs/node.git
Revert "path: resolve normalize drive letter to lower case"
This reverts commit f6e5740180
.
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: https://github.com/iojs/io.js/pull/100
Reviewed-By: Bert Belder <bertbelder@gmail.com>
pull/100/merge
parent
e3aa802b38
commit
e24fa83e69
|
@ -162,12 +162,6 @@ win32.resolve = function() {
|
||||||
resolvedTail = normalizeArray(resolvedTail.split(/[\\\/]+/).filter(f),
|
resolvedTail = normalizeArray(resolvedTail.split(/[\\\/]+/).filter(f),
|
||||||
!resolvedAbsolute).join('\\');
|
!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) ||
|
return (resolvedDevice + (resolvedAbsolute ? '\\' : '') + resolvedTail) ||
|
||||||
'.';
|
'.';
|
||||||
};
|
};
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
|
|
||||||
var common = require('../common');
|
var common = require('../common');
|
||||||
var assert = require('assert');
|
var assert = require('assert');
|
||||||
var path = require('path');
|
|
||||||
|
|
||||||
var module = require('module');
|
var module = require('module');
|
||||||
|
|
||||||
|
@ -30,7 +29,7 @@ var isWindows = process.platform === 'win32';
|
||||||
var file, delimiter, paths;
|
var file, delimiter, paths;
|
||||||
|
|
||||||
if (isWindows) {
|
if (isWindows) {
|
||||||
file = path.normalize('C:\\Users\\Rocko Artischocko\\node_stuff\\foo');
|
file = 'C:\\Users\\Rocko Artischocko\\node_stuff\\foo';
|
||||||
delimiter = '\\'
|
delimiter = '\\'
|
||||||
} else {
|
} else {
|
||||||
file = '/usr/test/lib/node_modules/npm/foo';
|
file = '/usr/test/lib/node_modules/npm/foo';
|
||||||
|
@ -40,4 +39,4 @@ if (isWindows) {
|
||||||
paths = module._nodeModulePaths(file);
|
paths = module._nodeModulePaths(file);
|
||||||
|
|
||||||
assert.ok(paths.indexOf(file + delimiter + 'node_modules') !== -1);
|
assert.ok(paths.indexOf(file + delimiter + 'node_modules') !== -1);
|
||||||
assert.ok(Array.isArray(paths));
|
assert.ok(Array.isArray(paths));
|
|
@ -311,7 +311,7 @@ if (isWindows) {
|
||||||
[['c:/ignore', 'd:\\a/b\\c/d', '\\e.exe'], 'd:\\e.exe'],
|
[['c:/ignore', 'd:\\a/b\\c/d', '\\e.exe'], 'd:\\e.exe'],
|
||||||
[['c:/ignore', 'c:/some/file'], 'c:\\some\\file'],
|
[['c:/ignore', 'c:/some/file'], 'c:\\some\\file'],
|
||||||
[['d:/ignore', 'd:some/dir//'], 'd:\\ignore\\some\\dir'],
|
[['d:/ignore', 'd:some/dir//'], 'd:\\ignore\\some\\dir'],
|
||||||
[['.'], path.normalize(process.cwd())],
|
[['.'], process.cwd()],
|
||||||
[['//server/share', '..', 'relative\\'], '\\\\server\\share\\relative'],
|
[['//server/share', '..', 'relative\\'], '\\\\server\\share\\relative'],
|
||||||
[['c:/', '//'], 'c:\\'],
|
[['c:/', '//'], 'c:\\'],
|
||||||
[['c:/', '//dir'], 'c:\\dir'],
|
[['c:/', '//dir'], 'c:\\dir'],
|
||||||
|
|
Loading…
Reference in New Issue