* 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
This commit is contained in:
parent
e58ec33721
commit
e3d685907c
@ -1,3 +1,8 @@
|
|||||||
|
Tue Jun 5 19:33:51 2012 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* process.c (proc_spawn): don't detect simple command line here
|
||||||
|
because rb_exec_fillarg already did.
|
||||||
|
|
||||||
Tue Jun 5 19:21:10 2012 Tanaka Akira <akr@fsij.org>
|
Tue Jun 5 19:21:10 2012 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* process.c (rb_exec_fillarg): bail out a loop eagerly.
|
* process.c (rb_exec_fillarg): bail out a loop eagerly.
|
||||||
|
17
process.c
17
process.c
@ -1278,13 +1278,8 @@ static rb_pid_t
|
|||||||
proc_spawn(char *str)
|
proc_spawn(char *str)
|
||||||
{
|
{
|
||||||
char fbuf[MAXPATHLEN];
|
char fbuf[MAXPATHLEN];
|
||||||
char *s, *t;
|
|
||||||
char **argv, **a;
|
|
||||||
rb_pid_t status;
|
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));
|
char *shell = dln_find_exe_r("sh", 0, fbuf, sizeof(fbuf));
|
||||||
before_exec();
|
before_exec();
|
||||||
status = spawnl(P_NOWAIT, (shell ? shell : "/bin/sh"), "sh", "-c", str, (char*)NULL);
|
status = spawnl(P_NOWAIT, (shell ? shell : "/bin/sh"), "sh", "-c", str, (char*)NULL);
|
||||||
@ -1292,18 +1287,6 @@ proc_spawn(char *str)
|
|||||||
after_exec();
|
after_exec();
|
||||||
return status;
|
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);
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user