summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-10 13:37:58 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-10 13:37:58 +0000
commit1f30b7437ec01f53b0656e325f1d100f04c0b2fa (patch)
tree15a8d3209501b308ad69709694f69c45d41b76ea /dir.c
parent6add0613a398759bfd3e67b1fe62113e9e03276d (diff)
dir.c: match in UTF-8
* dir.c (push_glob): match in UTF-8 on Mac OS X. [ruby-dev:48213] [Bug #9825] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/dir.c b/dir.c
index f456e8b..777fa55 100644
--- a/dir.c
+++ b/dir.c
@@ -1745,10 +1745,16 @@ static int
push_glob(VALUE ary, VALUE str, int flags)
{
struct glob_args args;
+#ifdef __APPLE__
+ rb_encoding *enc = rb_utf8_encoding();
+
+ str = rb_str_encode_ospath(str);
+#else
rb_encoding *enc = rb_enc_get(str);
if (enc == rb_usascii_encoding()) enc = rb_filesystem_encoding();
if (enc == rb_usascii_encoding()) enc = rb_ascii8bit_encoding();
+#endif
args.func = push_pattern;
args.value = ary;
args.enc = enc;