summaryrefslogtreecommitdiff
path: root/win32/win32.c
diff options
context:
space:
mode:
Diffstat (limited to 'win32/win32.c')
-rw-r--r--win32/win32.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 99802d07d0..1e658de156 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -851,6 +851,9 @@ is_internal_cmd(const char *cmd, int nt)
{
char cmdname[9], *b = cmdname, c;
+ if (strchr(cmd, '^'))
+ return 1;
+
do {
if (!(c = *cmd++)) return 0;
} while (isspace(c));
@@ -1139,6 +1142,12 @@ rb_w32_spawn(int mode, const char *cmd, const char *prog)
cmd = tmp;
}
else if ((shell = getenv("COMSPEC")) &&
+ strchr(cmd, '"')) {
+ char *tmp = ALLOCV(v, strlen(shell) + strlen(cmd) + sizeof(" /c "));
+ sprintf(tmp, "%s /c %s", shell, cmd);
+ cmd = tmp;
+ }
+ else if ((shell = getenv("COMSPEC")) &&
(nt = !is_command_com(shell),
(redir < 0 ? has_redirection(cmd) : redir) ||
is_internal_cmd(cmd, nt))) {