diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-02-20 04:04:59 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-02-20 04:04:59 +0000 |
commit | ad85bc7351e9bf39be6857644abcbfeefe036b44 (patch) | |
tree | ff4700fa6d4ad8cdfb21f97f29dbcce013dd9c11 /dir.c | |
parent | 63ffd80abd05d73b6648e93f9d6fbbe3fc5ce417 (diff) | |
download | ruby-ad85bc7351e9bf39be6857644abcbfeefe036b44.tar.gz |
dir.c: paths as UTF-8
* dir.c (push_pattern, push_glob): deal with read paths as UTF-8
to stat later, on Windows as well as OS X.
[ruby-core:73868] [Bug #12081]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r-- | dir.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -2050,7 +2050,7 @@ rb_glob(const char *path, void (*func)(const char *, VALUE, void *), VALUE arg) static void push_pattern(const char *path, VALUE ary, void *enc) { -#ifdef __APPLE__ +#if defined _WIN32 || defined __APPLE__ VALUE name = rb_utf8_str_new_cstr(path); rb_encoding *eenc = rb_default_internal_encoding(); OBJ_TAINT(name); @@ -2171,7 +2171,7 @@ push_glob(VALUE ary, VALUE str, int flags) struct push_glob_args args; rb_encoding *enc = rb_enc_get(str); -#ifdef __APPLE__ +#if defined _WIN32 || defined __APPLE__ str = rb_str_encode_ospath(str); #endif if (rb_enc_to_index(enc) == ENCINDEX_US_ASCII) @@ -2183,7 +2183,7 @@ push_glob(VALUE ary, VALUE str, int flags) args.glob.value = ary; args.glob.enc = enc; args.flags = flags; -#ifdef __APPLE__ +#if defined _WIN32 || defined __APPLE__ enc = rb_utf8_encoding(); #endif |