зеркало из https://github.com/github/ruby.git
* process.c (rb_exec_fillarg): bail out a loop eagerly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
5b13036fce
Коммит
e58ec33721
|
@ -1,3 +1,7 @@
|
|||
Tue Jun 5 19:21:10 2012 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* process.c (rb_exec_fillarg): bail out a loop eagerly.
|
||||
|
||||
Tue Jun 5 19:15:14 2012 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* process.c: add comments about async-signal-safe.
|
||||
|
|
|
@ -1805,10 +1805,12 @@ rb_exec_fillarg(VALUE prog, int argc, VALUE *argv, VALUE env, VALUE opthash, str
|
|||
int has_meta = 0;
|
||||
int has_nonspace = 0;
|
||||
for (p = RSTRING_PTR(prog); *p; p++) {
|
||||
if (*p != ' ' && *p != '\t')
|
||||
if (!has_nonspace && *p != ' ' && *p != '\t')
|
||||
has_nonspace = 1;
|
||||
if (strchr("*?{}[]<>()~&|\\$;'`\"\n", *p))
|
||||
if (!has_meta && strchr("*?{}[]<>()~&|\\$;'`\"\n", *p))
|
||||
has_meta = 1;
|
||||
if (has_nonspace && has_meta)
|
||||
break;
|
||||
}
|
||||
if (has_nonspace && !has_meta) {
|
||||
/* avoid shell since no shell meta charactor found. */
|
||||
|
|
Загрузка…
Ссылка в новой задаче