summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-25 09:54:07 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-25 09:54:07 +0000
commit028ae6cfaf2e322019bd389eeb5b93611c20fc0c (patch)
tree7a3673d64f6d34c94558543002ea6cf55adac4f9 /win32
parentae4b0c25f0b39a1647d0500602c4f5cb3d6da6bb (diff)
merges r20945 from trunk into ruby_1_9_1.
* win32/win32.c (rb_w32_spawn): deals with quoted commands. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21016 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, '/', '\\');
}