[前][次][番号順一覧][スレッド一覧]

ruby-changes:33823

From: nobu <ko1@a...>
Date: Sat, 10 May 2014 22:38:22 +0900 (JST)
Subject: [ruby-changes:33823] nobu:r45904 (trunk): dir.c: match in UTF-8

nobu	2014-05-10 22:37:58 +0900 (Sat, 10 May 2014)

  New Revision: 45904

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45904

  Log:
    dir.c: match in UTF-8
    
    * dir.c (push_glob): match in UTF-8 on Mac OS X.
      [ruby-dev:48213] [Bug #9825]

  Modified files:
    trunk/ChangeLog
    trunk/dir.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 45903)
+++ ChangeLog	(revision 45904)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat May 10 22:37:56 2014  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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@r...>
 
 	* thread.c (thread_start_func_2): stop if forked in a sub-thread,
Index: dir.c
===================================================================
--- dir.c	(revision 45903)
+++ dir.c	(revision 45904)
@@ -1745,10 +1745,16 @@ static int https://github.com/ruby/ruby/blob/trunk/dir.c#L1745
 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;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]