diff options
-rw-r--r-- | io.c | 2 | ||||
-rw-r--r-- | win32/win32.c | 14 |
2 files changed, 14 insertions, 2 deletions
@@ -2682,7 +2682,7 @@ pipe_open(argc, argv, pname, mode) #endif rb_thread_sleep(1); break; - defined: + default: rb_sys_fail(pname); break; } diff --git a/win32/win32.c b/win32/win32.c index 99907cc682..54164322f3 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -12,6 +12,7 @@ #include "ruby.h" #include "rubysig.h" +#include "dln.h" #include <fcntl.h> #include <process.h> #include <sys/stat.h> @@ -901,7 +902,18 @@ CreateChild(const char *cmd, const char *prog, SECURITY_ATTRIBUTES *psa, HANDLE dwCreationFlags = (NORMAL_PRIORITY_CLASS); if (prog) { - shell = prog; + char *p = dln_find_exe(prog, NULL); + if (!p) { + shell = prog; + } + else { + shell = p; + while (*p) { + if ((unsigned char)*p == '/') + *p = '\\'; + p = CharNext(p); + } + } } else { int redir = -1; |