mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
*** empty log message ***
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0c717d6a58
commit
ac8a2a31c2
3 changed files with 44 additions and 5 deletions
|
@ -1,3 +1,12 @@
|
|||
Sun Jan 14 18:21:30 2001 Usaku Nakamura <usa@osb.att.ne.jp>
|
||||
|
||||
* win32/config.status.in: add some field.
|
||||
|
||||
* win32/win32.c (isInternalCmd): ignore case for shell's internal
|
||||
command.
|
||||
|
||||
* win32/win32.c (do_spawn): recognize quoted command line.
|
||||
|
||||
Sun Jan 14 04:10:27 2001 Minero Aoki <aamine@dp.u-netsurf.ne.jp>
|
||||
|
||||
* lib/net/protocol.rb (adding): too few "yield" in case of arg is
|
||||
|
|
|
@ -60,9 +60,10 @@ s%@LIBRUBY@%$(RUBY_SO_NAME).lib%g
|
|||
s%@LIBRUBYARG@%$(RUBY_SO_NAME).lib%g
|
||||
s%@SOLIBS@%%g
|
||||
s%@DLDLIBS@%%g
|
||||
s%@ENABLE_SHARED@%yes%g
|
||||
s%@arch@%i586-mswin32%g
|
||||
s%@sitedir@%${prefix}/lib/ruby/site_ruby%g
|
||||
s%@configure_args@%--with-make-prog=nmake%g
|
||||
s%@configure_args@%--with-make-prog=nmake --enable-shared%g
|
||||
s%@configure_input@%$configure_input%g
|
||||
s%@srcdir@%$srcdir%g
|
||||
s%@top_srcdir@%$top_srcdir%g
|
||||
|
|
|
@ -357,7 +357,7 @@ isInternalCmd(char *cmd)
|
|||
int vecc = NtMakeCmdVector(cmd, &vec, FALSE);
|
||||
|
||||
for( i = 0; szInternalCmds[i] ; i++){
|
||||
if(!strcmp(szInternalCmds[i], vec[0])){
|
||||
if(!strcasecmp(szInternalCmds[i], vec[0])){
|
||||
fRet = 1;
|
||||
break;
|
||||
}
|
||||
|
@ -735,6 +735,8 @@ char *cmd;
|
|||
int status = -1;
|
||||
char *shell, *cmd2;
|
||||
int mode = NtSyncProcess ? P_WAIT : P_NOWAIT;
|
||||
char quote;
|
||||
char *exec;
|
||||
|
||||
/* save an extra exec if possible */
|
||||
if ((shell = getenv("RUBYSHELL")) != 0) {
|
||||
|
@ -778,20 +780,47 @@ char *cmd;
|
|||
a = argv;
|
||||
for (s = cmd2; *s;) {
|
||||
while (*s && isspace(*s)) s++;
|
||||
if (*s)
|
||||
if (*s == '"') {
|
||||
quote = *s;
|
||||
*(a++) = s++;
|
||||
while (*s) {
|
||||
if (*s == '\\' && *(s + 1) == quote) {
|
||||
memmove(s, s + 1, strlen(s) + 1);
|
||||
s++;
|
||||
}
|
||||
else if (*s == quote) {
|
||||
s++;
|
||||
break;
|
||||
}
|
||||
s++;
|
||||
}
|
||||
}
|
||||
else if (*s) {
|
||||
*(a++) = s;
|
||||
while (*s && !isspace(*s)) s++;
|
||||
while (*s && !isspace(*s)) s++;
|
||||
}
|
||||
if (*s)
|
||||
*s++ = '\0';
|
||||
}
|
||||
*a = NULL;
|
||||
exec = NULL;
|
||||
if (argv[0]) {
|
||||
if ((status = spawnvpe(mode, argv[0], argv, environ)) == -1) {
|
||||
exec = ALLOC_N(char, (strlen(argv[0]) + 1));
|
||||
if (argv[0][0] == '"' && argv[0][strlen(argv[0]) - 1] == '"') {
|
||||
strcpy(exec, &argv[0][1]);
|
||||
exec[strlen(exec) - 1] = '\0';
|
||||
}
|
||||
else {
|
||||
strcpy(exec, argv[0]);
|
||||
}
|
||||
if ((status = spawnvpe(mode, exec, argv, environ)) == -1) {
|
||||
free(exec);
|
||||
free(argv);
|
||||
free(cmd2);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
free(exec);
|
||||
free(cmd2);
|
||||
free(argv);
|
||||
return (int)((status & 0xff) << 8);
|
||||
|
|
Loading…
Reference in a new issue