diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-06-05 10:35:47 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-06-05 10:35:47 +0000 |
commit | e3d685907c140bd780d4108b80a83b036a0e32d4 (patch) | |
tree | f052149f8fbff9632d927c912479d90d7e10d11b /process.c | |
parent | e58ec3372190b0f9e294351a4e1ca603da01ca72 (diff) | |
download | ruby-e3d685907c140bd780d4108b80a83b036a0e32d4.tar.gz |
* process.c (proc_spawn): don't detect simple command line here
because rb_exec_fillarg already did.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r-- | process.c | 27 |
1 files changed, 5 insertions, 22 deletions
@@ -1278,30 +1278,13 @@ static rb_pid_t proc_spawn(char *str) { char fbuf[MAXPATHLEN]; - char *s, *t; - char **argv, **a; rb_pid_t status; - VALUE v; - for (s = str; *s; s++) { - if (*s != ' ' && !ISALPHA(*s) && strchr("*?{}[]<>()~&|\\$;'`\"\n",*s)) { - char *shell = dln_find_exe_r("sh", 0, fbuf, sizeof(fbuf)); - before_exec(); - status = spawnl(P_NOWAIT, (shell ? shell : "/bin/sh"), "sh", "-c", str, (char*)NULL); - rb_last_status_set(status == -1 ? 127 : status, 0); - after_exec(); - return status; - } - } - a = argv = ALLOC_ARGV_WITH_STR((s - str) / 2 + 2, v, s, s - str + 1); - strcpy(s, str); - if (*a++ = strtok(s, " \t")) { - while (t = strtok(NULL, " \t")) - *a++ = t; - *a = NULL; - } - status = argv[0] ? proc_spawn_v(argv, 0) : -1; - ALLOCV_END(v); + char *shell = dln_find_exe_r("sh", 0, fbuf, sizeof(fbuf)); + before_exec(); + status = spawnl(P_NOWAIT, (shell ? shell : "/bin/sh"), "sh", "-c", str, (char*)NULL); + rb_last_status_set(status == -1 ? 127 : status, 0); + after_exec(); return status; } #endif |