1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

load.c: fix r54521

* load.c (rb_f_load): do not convert the encoding twice.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-04-09 03:58:01 +00:00
parent 404bf57aaf
commit e6c88132a5

7
load.c
View file

@ -698,16 +698,13 @@ static VALUE
rb_f_load(int argc, VALUE *argv)
{
VALUE fname, wrap, path, orig_fname;
int safe;
rb_scan_args(argc, argv, "11", &fname, &wrap);
RUBY_DTRACE_HOOK(LOAD_ENTRY, StringValuePtr(fname));
safe = rb_safe_level();
orig_fname = rb_get_path_check_to_string(fname, safe);
fname = rb_get_path_check_convert(fname, orig_fname, safe);
fname = rb_str_encode_ospath(fname);
orig_fname = rb_get_path_check_to_string(fname, rb_safe_level());
fname = rb_str_encode_ospath(orig_fname);
path = rb_find_file(fname);
if (!path) {
if (!rb_file_load_ok(RSTRING_PTR(fname)))