summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEd Morley <emorley@mozilla.com>2014-05-13 13:20:36 +0100
committerFedor Indutny <fedor@indutny.com>2014-06-24 08:44:11 +0400
commitc08da463adab71c05017ad6fe81927fa66e2e11e (patch)
treea5b3cb6b4f96e9d810b75a248bdd0e5315f54089 /lib
parent4f1782ef750fb171eb90a1d97b14e2ed3a8a165d (diff)
downloadnode-new-c08da463adab71c05017ad6fe81927fa66e2e11e.tar.gz
child_process: use full path for cmd.exe on Win32
Currently child_process.exec() assumes that cmd.exe is on the PATH, and fails with a spawn ENOENT error if it is not. The Windows 'comspec' environment variable contains the full filepath to the default command interpreter, eg "C:\Windows\System32\cmd.exe". Should it not be set, we fall-back to using 'cmd.exe' from PATH, as before. Signed-off-by: Fedor Indutny <fedor@indutny.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/child_process.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/child_process.js b/lib/child_process.js
index 462decbd84..d6017d18ff 100644
--- a/lib/child_process.js
+++ b/lib/child_process.js
@@ -608,7 +608,7 @@ function normalizeExecArgs(command /*, options, callback */) {
}
if (process.platform === 'win32') {
- file = 'cmd.exe';
+ file = process.env.comspec || 'cmd.exe';
args = ['/s', '/c', '"' + command + '"'];
// Make a shallow copy before patching so we don't clobber the user's
// options object.