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

load.c: raise name before conversion

* load.c (rb_f_load): raise with the original path name before
  encoding conversion.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-04-09 01:03:15 +00:00
parent 7aa83cd0f8
commit 56417d1f24
2 changed files with 10 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Sat Apr 9 10:03:12 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* load.c (rb_f_load): raise with the original path name before
encoding conversion.
Sat Apr 9 02:05:10 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* bignum.c (rb_cstr_parse_inum): [EXPERIMENTAL] new function to

7
load.c
View file

@ -698,13 +698,16 @@ 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));
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)))