From: Ryan Dahl Date: Sun, 31 Jul 2011 23:50:45 +0000 (-0700) Subject: child_process_uv: fix simple/test-child-process-cwd X-Git-Tag: v0.5.3~29 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ef767a152b1033c1dc67631b8cc377fb3acb933d;p=platform%2Fupstream%2Fnodejs.git child_process_uv: fix simple/test-child-process-cwd --- diff --git a/Makefile b/Makefile index 5d7248a..c574d27 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 9c56b01..a26e3b5 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