diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-27 14:47:23 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-27 14:47:23 +0000 |
commit | 84abef0fc08f7182f9c76175ef478898612b0bdf (patch) | |
tree | c1cfa14d716f76a560b12035361b844ccb2e0431 /file.c | |
parent | ac8346c4c3031126b455bf71e6a7381dd0378386 (diff) |
* file.c (file_expand_path): set encoding as the same of fname
when _result_ is not filesystem encoding. [ruby-dev:41429]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -2895,6 +2895,7 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result) xfree(dir); rb_enc_associate_index(result, rb_filesystem_encindex()); } + else rb_enc_copy(result, fname); p = chompdirsep(skiproot(buf)); s += 2; } @@ -2904,6 +2905,7 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result) if (!NIL_P(dname)) { file_expand_path(dname, Qnil, abs_mode, result); BUFINIT(); + rb_enc_copy(result, fname); } else { char *dir = my_getcwd(); |