From c68d29960b4027da6fed55576a523f42f6182f28 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 23 Aug 2012 07:46:12 +0000 Subject: load.c: keep encoding of feature name * file.c (rb_find_file_ext_safe, rb_find_file_safe): default to US-ASCII for encdb and transdb. * load.c (search_required): keep encoding of feature name. set loading path to filesystem encoding. [Bug #6377][ruby-core:44750] * ruby.c (add_modules, require_libraries): assume default external encoding as well as ARGV. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- file.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'file.c') diff --git a/file.c b/file.c index 4050067870..24aa1115fe 100644 --- a/file.c +++ b/file.c @@ -5243,6 +5243,7 @@ rb_find_file_ext_safe(VALUE *filep, const char *const *ext, int safe_level) RBASIC(fname)->klass = 0; fnlen = RSTRING_LEN(fname); tmp = rb_str_tmp_new(MAXPATHLEN + 2); + rb_enc_associate_index(tmp, rb_usascii_encindex()); for (j=0; ext[j]; j++) { rb_str_cat2(fname, ext[j]); for (i = 0; i < RARRAY_LEN(load_path); i++) { @@ -5305,6 +5306,7 @@ rb_find_file_safe(VALUE path, int safe_level) long i; tmp = rb_str_tmp_new(MAXPATHLEN + 2); + rb_enc_associate_index(tmp, rb_usascii_encindex()); for (i = 0; i < RARRAY_LEN(load_path); i++) { VALUE str = RARRAY_PTR(load_path)[i]; RB_GC_GUARD(str) = rb_get_path_check(str, safe_level); -- cgit v1.2.3