mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
6add0613a3
commit
1f30b7437e
2 changed files with 11 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Sat May 10 22:37:56 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* dir.c (push_glob): match in UTF-8 on Mac OS X.
|
||||||
|
[ruby-dev:48213] [Bug #9825]
|
||||||
|
|
||||||
Sat May 10 13:32:18 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Sat May 10 13:32:18 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* thread.c (thread_start_func_2): stop if forked in a sub-thread,
|
* thread.c (thread_start_func_2): stop if forked in a sub-thread,
|
||||||
|
|
6
dir.c
6
dir.c
|
@ -1745,10 +1745,16 @@ static int
|
||||||
push_glob(VALUE ary, VALUE str, int flags)
|
push_glob(VALUE ary, VALUE str, int flags)
|
||||||
{
|
{
|
||||||
struct glob_args args;
|
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);
|
rb_encoding *enc = rb_enc_get(str);
|
||||||
|
|
||||||
if (enc == rb_usascii_encoding()) enc = rb_filesystem_encoding();
|
if (enc == rb_usascii_encoding()) enc = rb_filesystem_encoding();
|
||||||
if (enc == rb_usascii_encoding()) enc = rb_ascii8bit_encoding();
|
if (enc == rb_usascii_encoding()) enc = rb_ascii8bit_encoding();
|
||||||
|
#endif
|
||||||
args.func = push_pattern;
|
args.func = push_pattern;
|
||||||
args.value = ary;
|
args.value = ary;
|
||||||
args.enc = enc;
|
args.enc = enc;
|
||||||
|
|
Loading…
Reference in a new issue