Skip to content

Commit ea945bf

Browse files
juamedgodbnoordhuis
authored andcommitted
lib,src: fix spawnSync ignoring its 'env' option
PR-URL: nodejs/node-v0.x-archive#8546 Reviewed-By: Colin Ihrig <[email protected]>
1 parent 691d55f commit ea945bf

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/child_process.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,6 +1264,7 @@ function spawnSync(/*file, args, options*/) {
12641264

12651265
options.file = opts.file;
12661266
options.args = opts.args;
1267+
options.envPairs = opts.envPairs;
12671268

12681269
if (options.killSignal)
12691270
options.killSignal = lookupSignal(options.killSignal);

src/spawn_sync.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -736,9 +736,9 @@ int SyncProcessRunner::ParseOptions(Local<Value> js_value) {
736736
r = CopyJsStringArray(js_env_pairs, &env_buffer_);
737737
if (r < 0)
738738
return r;
739-
uv_process_options_.args = reinterpret_cast<char**>(env_buffer_);
740-
}
741739

740+
uv_process_options_.env = reinterpret_cast<char**>(env_buffer_);
741+
}
742742
Local<Value> js_uid = js_options->Get(env()->uid_string());
743743
if (IsSet(js_uid)) {
744744
if (!CheckRange<uv_uid_t>(js_uid))

0 commit comments

Comments
 (0)