mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* dir.c (push_glob): add RB_GC_GUARD to prevent str being free'ed.
a patch from Masaya TARUI in [ruby-dev:40939]. [ruby-dev:40514] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e9cfe47700
commit
5dd8daaa27
2 changed files with 10 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
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.
|
||||||
|
a patch from Masaya TARUI in [ruby-dev:40939]. [ruby-dev:40514]
|
||||||
|
|
||||||
Fri Apr 9 10:53:00 2010 Kenta Murata <mrkn@mrkn.jp>
|
Fri Apr 9 10:53:00 2010 Kenta Murata <mrkn@mrkn.jp>
|
||||||
|
|
||||||
* compile.c (iseq_compile_each): stop hiding, and freeze unpopped
|
* compile.c (iseq_compile_each): stop hiding, and freeze unpopped
|
||||||
|
|
5
dir.c
5
dir.c
|
@ -1622,14 +1622,17 @@ 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;
|
||||||
|
|
||||||
return ruby_brace_glob0(RSTRING_PTR(str), flags | GLOB_VERBOSE,
|
ret = ruby_brace_glob0(RSTRING_PTR(str), flags | GLOB_VERBOSE,
|
||||||
rb_glob_caller, (VALUE)&args, enc);
|
rb_glob_caller, (VALUE)&args, enc);
|
||||||
|
RB_GC_GUARD(str);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue