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

* file.c (file_path_convert): fix fs_encoding is not assign.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2009-11-24 01:20:18 +00:00
parent d7ffefb405
commit c796b348c6
2 changed files with 6 additions and 2 deletions

View file

@ -1,3 +1,7 @@
Tue Nov 24 10:17:38 2009 NARUSE, Yui <naruse@ruby-lang.org>
* file.c (file_path_convert): fix fs_encoding is not assign.
Tue Nov 24 10:00:00 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> Tue Nov 24 10:00:00 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* error.c (rb_strerrno): constified. * error.c (rb_strerrno): constified.

4
file.c
View file

@ -103,7 +103,7 @@ VALUE rb_cStat;
#define insecure_obj_p(obj, level) (level >= 4 || (level > 0 && OBJ_TAINTED(obj))) #define insecure_obj_p(obj, level) (level >= 4 || (level > 0 && OBJ_TAINTED(obj)))
VALUE static VALUE
file_path_convert(VALUE name) file_path_convert(VALUE name)
{ {
#ifndef _WIN32 /* non Windows == Unix */ #ifndef _WIN32 /* non Windows == Unix */
@ -113,7 +113,7 @@ file_path_convert(VALUE name)
/* Mac OS X's file system encoding is UTF-8 */ /* Mac OS X's file system encoding is UTF-8 */
if (rb_usascii_encoding() != fname_encoding if (rb_usascii_encoding() != fname_encoding
&& rb_ascii8bit_encoding() != fname_encoding && rb_ascii8bit_encoding() != fname_encoding
&& rb_utf8_encoding() != fname_encoding && (fs_encoding = rb_filesystem_encoding()) != fname_encoding
&& rb_enc_find("UTF8-MAC") != fname_encoding) { && rb_enc_find("UTF8-MAC") != fname_encoding) {
/* Don't call rb_enc_find() before UTF-8 */ /* Don't call rb_enc_find() before UTF-8 */
name = rb_str_conv_enc(name, fname_encoding, fs_encoding); name = rb_str_conv_enc(name, fname_encoding, fs_encoding);