summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--win32/config.status.in3
-rw-r--r--win32/win32.c37
3 files changed, 44 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index fa8697e8a18..d8df1399ed1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/win32/config.status.in b/win32/config.status.in
index 598eb792fe9..90a71c9dd72 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 bd07bb644e1..78e0069b3e0 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);