* win32/win32.c (CreateChild): need to quote cmd if RUBYSHELL is set.
* win32/win32.c (CreateChild): fix condition about whether to call shell or not. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b6367d64f4
commit
05ea0b76e6
@ -1,3 +1,10 @@
|
|||||||
|
Sat Sep 6 01:23:22 2003 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* win32/win32.c (CreateChild): need to quote cmd if RUBYSHELL is set.
|
||||||
|
|
||||||
|
* win32/win32.c (CreateChild): fix condition about whether to call
|
||||||
|
shell or not.
|
||||||
|
|
||||||
Sat Sep 6 00:36:20 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
Sat Sep 6 00:36:20 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
* Makefile.in (test): phony target.
|
* Makefile.in (test): phony target.
|
||||||
|
@ -910,23 +910,28 @@ CreateChild(char *cmd, char *prog, SECURITY_ATTRIBUTES *psa, HANDLE hInput, HAND
|
|||||||
|
|
||||||
dwCreationFlags = (NORMAL_PRIORITY_CLASS);
|
dwCreationFlags = (NORMAL_PRIORITY_CLASS);
|
||||||
|
|
||||||
shell = NULL;
|
|
||||||
if (prog) {
|
if (prog) {
|
||||||
shell = prog;
|
shell = prog;
|
||||||
}
|
}
|
||||||
else if (has_redirection(cmd)) {
|
else {
|
||||||
if (shell = getenv("RUBYSHELL")) {
|
int redir = -1;
|
||||||
|
if ((shell = getenv("RUBYSHELL")) && (redir = has_redirection(cmd))) {
|
||||||
char *tmp = ALLOCA_N(char, strlen(shell) + strlen(cmd) +
|
char *tmp = ALLOCA_N(char, strlen(shell) + strlen(cmd) +
|
||||||
sizeof (" -c "));
|
sizeof (" -c ") + 2);
|
||||||
sprintf(tmp, "%s -c %s", shell, cmd);
|
sprintf(tmp, "%s -c \"%s\"", shell, cmd);
|
||||||
cmd = tmp;
|
cmd = tmp;
|
||||||
}
|
}
|
||||||
else if ((shell = getenv("COMSPEC")) && isInternalCmd(cmd, shell)) {
|
else if ((shell = getenv("COMSPEC")) &&
|
||||||
|
((redir < 0 ? has_redirection(cmd) : redir) ||
|
||||||
|
isInternalCmd(cmd, shell))) {
|
||||||
char *tmp = ALLOCA_N(char, strlen(shell) + strlen(cmd) +
|
char *tmp = ALLOCA_N(char, strlen(shell) + strlen(cmd) +
|
||||||
sizeof (" /c "));
|
sizeof (" /c "));
|
||||||
sprintf(tmp, "%s /c %s", shell, cmd);
|
sprintf(tmp, "%s /c %s", shell, cmd);
|
||||||
cmd = tmp;
|
cmd = tmp;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
shell = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RUBY_CRITICAL({
|
RUBY_CRITICAL({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user