diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-01-21 15:38:57 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-01-21 15:38:57 +0000 |
commit | 8715551b9c187f86e16764a6de1af62763eb37f0 (patch) | |
tree | 60548fc37c3aa07bee652645195ccf12faa4acb9 /load.c | |
parent | 12ef4f02289dfada188581578d6388d06654c0c5 (diff) |
merge revision(s) r48186: [Backport #10448]
* load.c (rb_f_load): path name needs to be transcoded to OS path
encoding. [ruby-list:49994]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@49366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'load.c')
-rw-r--r-- | load.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -683,7 +683,7 @@ rb_load_protect(VALUE fname, int wrap, int *state) static VALUE rb_f_load(int argc, VALUE *argv) { - VALUE fname, wrap, path; + VALUE fname, wrap, path, orig_fname; rb_scan_args(argc, argv, "11", &fname, &wrap); @@ -693,10 +693,12 @@ rb_f_load(int argc, VALUE *argv) rb_sourceline()); } - path = rb_find_file(FilePathValue(fname)); + orig_fname = FilePathValue(fname); + fname = rb_str_encode_ospath(orig_fname); + path = rb_find_file(fname); if (!path) { if (!rb_file_load_ok(RSTRING_PTR(fname))) - load_failed(fname); + load_failed(orig_fname); path = fname; } rb_load_internal(path, RTEST(wrap)); |