summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-23 10:51:27 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-23 10:51:27 +0000
commit7c152e7f08b1a4f5b4fd7872443b1f18d5276820 (patch)
treea8c1e7ed633438869e4cd8ad31d5e6025e2ca182 /win32
parent6fcaf92943879dfbf8cff0354b6ea08aacadc8ea (diff)
downloadruby-7c152e7f08b1a4f5b4fd7872443b1f18d5276820.tar.gz
* win32/win32.c (rb_w32_spawn): deals with quoted commands.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/win32/win32.c b/win32/win32.c
index e111bf87ec..d346a925d6 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -918,6 +918,13 @@ rb_w32_spawn(int mode, const char *cmd, const char *prog)
}
else {
int len = 0;
+ if (*cmd == '"') {
+ for (prog = cmd + 1; *prog && *prog != '"'; prog = CharNext(prog));
+ len = prog - cmd - 1;
+ STRNDUPA(p, cmd + 1, len);
+ p = dln_find_exe_r(p, NULL, fbuf, sizeof(fbuf));
+ if (p) goto command_found;
+ }
for (prog = cmd; *prog; prog = CharNext(prog)) {
if (ISSPACE(*prog)) {
len = prog - cmd;
@@ -955,6 +962,7 @@ rb_w32_spawn(int mode, const char *cmd, const char *prog)
}
}
if (p) {
+ command_found:
shell = p;
translate_char(p, '/', '\\');
}