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
path: root/src
diff options
context:
space:
mode:
authorBert Belder <bertbelder@gmail.com>2010-11-30 12:39:01 +0300
committerBert Belder <bertbelder@gmail.com>2010-12-21 01:51:27 +0300
commitfe804d9bc7c4f0cca1f428acab1fd45155c956a9 (patch)
tree92233f13566bd12a51cf14f71a0094f9cdf813a6 /src
parent9be07f7fe196c574a895e12cc5b372c292edfc9d (diff)
_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
Diffstat (limited to 'src')
-rw-r--r--src/node.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/node.js b/src/node.js
index 43ccdb03258..2bb46a60f5e 100644
--- a/src/node.js
+++ b/src/node.js
@@ -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