ruby-changes:42447
From: nobu <ko1@a...>
Date: Sat, 9 Apr 2016 09:06:37 +0900 (JST)
Subject: [ruby-changes:42447] nobu:r54521 (trunk): load.c: raise name before conversion
nobu 2016-04-09 10:03:15 +0900 (Sat, 09 Apr 2016) New Revision: 54521 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54521 Log: load.c: raise name before conversion * load.c (rb_f_load): raise with the original path name before encoding conversion. Modified files: trunk/ChangeLog trunk/load.c Index: ChangeLog =================================================================== --- ChangeLog (revision 54520) +++ ChangeLog (revision 54521) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sat Apr 9 10:03:12 2016 Nobuyoshi Nakada <nobu@r...> + + * load.c (rb_f_load): raise with the original path name before + encoding conversion. + Sat Apr 9 02:05:10 2016 Nobuyoshi Nakada <nobu@r...> * bignum.c (rb_cstr_parse_inum): [EXPERIMENTAL] new function to Index: load.c =================================================================== --- load.c (revision 54520) +++ load.c (revision 54521) @@ -698,13 +698,16 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/load.c#L698 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)); - orig_fname = FilePathValue(fname); - fname = rb_str_encode_ospath(orig_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); path = rb_find_file(fname); if (!path) { if (!rb_file_load_ok(RSTRING_PTR(fname))) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/