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

ruby-changes:16088

From: naruse <ko1@a...>
Date: Thu, 27 May 2010 23:47:42 +0900 (JST)
Subject: [ruby-changes:16088] Ruby:r28039 (trunk): * file.c (file_expand_path): set encoding as the same of fname

naruse	2010-05-27 23:47:23 +0900 (Thu, 27 May 2010)

  New Revision: 28039

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

  Log:
    * file.c (file_expand_path): set encoding as the same of fname
      when _result_ is not filesystem encoding. [ruby-dev:41429]

  Modified files:
    trunk/ChangeLog
    trunk/file.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 28038)
+++ ChangeLog	(revision 28039)
@@ -1,3 +1,8 @@
+Thu May 27 23:29:18 2010  NARUSE, Yui  <naruse@r...>
+
+	* file.c (file_expand_path): set encoding as the same of fname
+	  when _result_ is not filesystem encoding. [ruby-dev:41429]
+
 Thu May 27 23:07:45 2010  NARUSE, Yui  <naruse@r...>
 
 	* file.c (file_expand_path): use rb_enc_associate_index and
Index: file.c
===================================================================
--- file.c	(revision 28038)
+++ file.c	(revision 28039)
@@ -2895,6 +2895,7 @@
 		xfree(dir);
 		rb_enc_associate_index(result, rb_filesystem_encindex());
 	    }
+	    else rb_enc_copy(result, fname);
 	    p = chompdirsep(skiproot(buf));
 	    s += 2;
 	}
@@ -2904,6 +2905,7 @@
 	if (!NIL_P(dname)) {
 	    file_expand_path(dname, Qnil, abs_mode, result);
 	    BUFINIT();
+	    rb_enc_copy(result, fname);
 	}
 	else {
 	    char *dir = my_getcwd();

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

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