зеркало из https://github.com/github/ruby.git
* dir.c (push_glob): clear up the previous commit (RB_GC_GUARD can
precede the last reference). [ruby-dev:40942] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
5dd8daaa27
Коммит
1f2def7dd8
|
@ -1,3 +1,8 @@
|
||||||
|
Fri Apr 9 20:29:13 2010 Yusuke Endoh <mame@tsg.ne.jp>
|
||||||
|
|
||||||
|
* dir.c (push_glob): clear up the previous commit (RB_GC_GUARD can
|
||||||
|
precede the last reference). [ruby-dev:40942]
|
||||||
|
|
||||||
Fri Apr 9 20:05:05 2010 Yusuke Endoh <mame@tsg.ne.jp>
|
Fri Apr 9 20:05:05 2010 Yusuke Endoh <mame@tsg.ne.jp>
|
||||||
|
|
||||||
* dir.c (push_glob): add RB_GC_GUARD to prevent str being free'ed.
|
* dir.c (push_glob): add RB_GC_GUARD to prevent str being free'ed.
|
||||||
|
|
6
dir.c
6
dir.c
|
@ -1622,17 +1622,15 @@ push_glob(VALUE ary, VALUE str, int flags)
|
||||||
{
|
{
|
||||||
struct glob_args args;
|
struct glob_args args;
|
||||||
rb_encoding *enc = rb_enc_get(str);
|
rb_encoding *enc = rb_enc_get(str);
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (enc == rb_usascii_encoding()) enc = rb_filesystem_encoding();
|
if (enc == rb_usascii_encoding()) enc = rb_filesystem_encoding();
|
||||||
args.func = push_pattern;
|
args.func = push_pattern;
|
||||||
args.value = ary;
|
args.value = ary;
|
||||||
args.enc = enc;
|
args.enc = enc;
|
||||||
|
|
||||||
ret = ruby_brace_glob0(RSTRING_PTR(str), flags | GLOB_VERBOSE,
|
|
||||||
rb_glob_caller, (VALUE)&args, enc);
|
|
||||||
RB_GC_GUARD(str);
|
RB_GC_GUARD(str);
|
||||||
return ret;
|
return ruby_brace_glob0(RSTRING_PTR(str), flags | GLOB_VERBOSE,
|
||||||
|
rb_glob_caller, (VALUE)&args, enc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
|
Загрузка…
Ссылка в новой задаче