diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-08-23 07:46:12 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-08-23 07:46:12 +0000 |
commit | c68d29960b4027da6fed55576a523f42f6182f28 (patch) | |
tree | b045e6c69426ce719b704ab6a977afcc8cb4f8fe /file.c | |
parent | 2933909caf01896d45eefa23e9c839fd1e03d652 (diff) | |
download | ruby-c68d29960b4027da6fed55576a523f42f6182f28.tar.gz |
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
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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); |