mirror of
https://github.com/nodejs/node-v0.x-archive.git
synced 2026-04-28 03:01:10 -04:00
_Partial_ backslash support in node.js argv directory munging
Doesn't do it when node is started from another drive using a drive-relative path. E.g: d: cd nodejs c: d:node.exe d:test.js
This commit is contained in:
@@ -530,14 +530,16 @@
|
||||
var path = requireNative('path');
|
||||
|
||||
// Make process.argv[0] and process.argv[1] into full paths.
|
||||
if (process.argv[0].indexOf('/') > 0) {
|
||||
if ('/\\'.indexOf(process.argv[0].charAt(0)) < 0
|
||||
&& process.argv[0].charAt(1) != ':') {
|
||||
process.argv[0] = path.join(cwd, process.argv[0]);
|
||||
}
|
||||
|
||||
if (process.argv[1]) {
|
||||
// Load module
|
||||
if (process.argv[1].charAt(0) != '/' &&
|
||||
!(/^http:\/\//).exec(process.argv[1])) {
|
||||
if ('/\\'.indexOf(process.argv[1].charAt(0)) < 0
|
||||
&& process.argv[1].charAt(1) != ':'
|
||||
&& !(/^http:\/\//).exec(process.argv[1])) {
|
||||
process.argv[1] = path.join(cwd, process.argv[1]);
|
||||
}
|
||||
// REMOVEME: nextTick should not be necessary. This hack to get
|
||||
|
||||
Reference in New Issue
Block a user