child_process_uv: fix simple/test-child-process-cwd
authorRyan Dahl <ry@tinyclouds.org>
Sun, 31 Jul 2011 23:50:45 +0000 (16:50 -0700)
committerRyan Dahl <ry@tinyclouds.org>
Sun, 31 Jul 2011 23:50:53 +0000 (16:50 -0700)
Makefile
src/process_wrap.cc

index 5d7248a..c574d27 100644 (file)
--- 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
index 9c56b01..a26e3b5 100644 (file)
@@ -107,7 +107,9 @@ class ProcessWrap : public HandleWrap {
     Local<Value> 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