summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-01-14 09:22:24 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-01-14 09:22:24 +0000
commitac8a2a31c2103abc249544469910ea3ff97f883c (patch)
tree26e58ed83929d3a2aec21cd72adf1b1dd5ff0423 /win32
parent0c717d6a589579ccc1f18e1eeacfbda7d7fcf9e5 (diff)
*** empty log message ***
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/config.status.in3
-rw-r--r--win32/win32.c37
2 files changed, 35 insertions, 5 deletions
diff --git a/win32/config.status.in b/win32/config.status.in
index 598eb79..90a71c9 100644
--- a/win32/config.status.in
+++ b/win32/config.status.in
@@ -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
diff --git a/win32/win32.c b/win32/win32.c
index bd07bb6..78e0069 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -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);