summaryrefslogtreecommitdiff
path: root/win32/win32.c
diff options
context:
space:
mode:
Diffstat (limited to 'win32/win32.c')
-rw-r--r--win32/win32.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 5ffe59807e..90e7250426 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -1055,7 +1055,6 @@ rb_w32_spawn(int mode, const char *cmd, const char *prog)
}
else {
int len = 0, quote = (*cmd == '"') ? '"' : 0;
- const char *comspec = shell;
for (prog = cmd + !!quote;; prog = CharNext(prog)) {
if (!*prog) {
len = prog - cmd;
@@ -1078,7 +1077,7 @@ rb_w32_spawn(int mode, const char *cmd, const char *prog)
}
shell = dln_find_exe_r(shell, NULL, fbuf, sizeof(fbuf));
if (!shell) {
- shell = comspec;
+ shell = p ? p : cmd;
}
else {
len = strlen(shell);