ruby-changes:39950
From: nobu <ko1@a...>
Date: Mon, 5 Oct 2015 00:53:58 +0900 (JST)
Subject: [ruby-changes:39950] nobu:r52031 (trunk): dir.c: make ASCII-8BIT
nobu 2015-10-05 00:53:53 +0900 (Mon, 05 Oct 2015) New Revision: 52031 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52031 Log: dir.c: make ASCII-8BIT * dir.c (rb_dir_getwd): make ASCII-8BIT if filesystem encoding is US-ASCII, like as Dir.glob. Modified files: trunk/ChangeLog trunk/dir.c Index: ChangeLog =================================================================== --- ChangeLog (revision 52030) +++ ChangeLog (revision 52031) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Mon Oct 5 00:53:51 2015 Nobuyoshi Nakada <nobu@r...> + + * dir.c (rb_dir_getwd): make ASCII-8BIT if filesystem encoding is + US-ASCII, like as Dir.glob. + Sun Oct 4 23:39:09 2015 Tanaka Akira <akr@f...> * enum.c (nmin_filter): Fix limit value. Index: dir.c =================================================================== --- dir.c (revision 52030) +++ dir.c (revision 52031) @@ -1010,7 +1010,9 @@ rb_dir_getwd(void) https://github.com/ruby/ruby/blob/trunk/dir.c#L1010 { char *path; VALUE cwd; + int fsenc = rb_enc_to_index(rb_filesystem_encoding()); + if (fsenc == ENCINDEX_US_ASCII) fsenc = ENCINDEX_ASCII; path = my_getcwd(); #ifdef __APPLE__ cwd = rb_str_normalize_ospath(path, strlen(path)); @@ -1018,7 +1020,7 @@ rb_dir_getwd(void) https://github.com/ruby/ruby/blob/trunk/dir.c#L1020 #else cwd = rb_tainted_str_new2(path); #endif - rb_enc_associate(cwd, rb_filesystem_encoding()); + rb_enc_associate_index(cwd, fsenc); xfree(path); return cwd; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/