From ef767a152b1033c1dc67631b8cc377fb3acb933d Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Sun, 31 Jul 2011 16:50:45 -0700 Subject: [PATCH] child_process_uv: fix simple/test-child-process-cwd --- Makefile | 1 + src/process_wrap.cc | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5d7248a52a..c574d27d53 100644 --- a/Makefile +++ b/Makefile @@ -237,6 +237,7 @@ UVTEST += simple/test-tls-set-encoding UVTEST += simple/test-child-process-exit-code UVTEST += simple/test-child-process-buffering UVTEST += simple/test-child-process-exec-cwd +UVTEST += simple/test-child-process-cwd test-uv: all diff --git a/src/process_wrap.cc b/src/process_wrap.cc index 9c56b01583..a26e3b5330 100644 --- a/src/process_wrap.cc +++ b/src/process_wrap.cc @@ -107,7 +107,9 @@ class ProcessWrap : public HandleWrap { Local cwd_v = js_options->Get(String::New("cwd")); if (!cwd_v.IsEmpty() && cwd_v->IsString()) { String::Utf8Value cwd(cwd_v->ToString()); - options.cwd = strdup(*cwd); + if (cwd.length() > 0) { + options.cwd = strdup(*cwd); + } } // options.env