MRI binding: changes to Marshal::load mkxp's custom proc #2

Merged
cremno merged 2 commits from mri-marshal-utf8proc into master 2013-10-23 03:29:51 +00:00
1 changed files with 3 additions and 2 deletions
Showing only changes of commit 8c45a5b11e - Show all commits

View File

@ -165,10 +165,11 @@ static VALUE stringForceUTF8(VALUE arg)
return arg;
}
static VALUE marshal_load_custom_proc(VALUE arg, VALUE proc)
static VALUE customProc(VALUE arg, VALUE proc)
{
VALUE obj = stringForceUTF8(arg);
obj = rb_funcall2(proc, rb_intern("call"), 1, &obj);
return obj;
}
@ -184,7 +185,7 @@ RB_METHOD(_marshalLoad)
if (NIL_P(proc))
utf8Proc = rb_proc_new(RUBY_METHOD_FUNC(stringForceUTF8), Qnil);
else
utf8Proc = rb_proc_new(RUBY_METHOD_FUNC(marshal_load_custom_proc), proc);
utf8Proc = rb_proc_new(RUBY_METHOD_FUNC(customProc), proc);
VALUE marsh = rb_const_get(rb_cObject, rb_intern("Marshal"));