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

ruby-changes:43194

From: nobu <ko1@a...>
Date: Fri, 3 Jun 2016 21:27:29 +0900 (JST)
Subject: [ruby-changes:43194] nobu:r55268 (trunk): ruby.c: refix r55260

nobu	2016-06-03 21:27:24 +0900 (Fri, 03 Jun 2016)

  New Revision: 55268

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55268

  Log:
    ruby.c: refix r55260
    
    * ruby.c (process_options): rb_str_conv_enc() never set encoding
      of the source string, but returns the string itself if the
      conversion failed.  then the instance variable does not need to
      be set again.

  Modified files:
    trunk/ChangeLog
    trunk/ruby.c
Index: ruby.c
===================================================================
--- ruby.c	(revision 55267)
+++ ruby.c	(revision 55268)
@@ -1568,7 +1568,9 @@ process_options(int argc, char **argv, s https://github.com/ruby/ruby/blob/trunk/ruby.c#L1568
 	    VALUE path = RARRAY_AREF(load_path, i);
 	    int mark = rb_attr_get(path, id_initial_load_path_mark) == path;
 #if UTF8_PATH
-	    path = rb_str_conv_enc(rb_str_dup(path), uenc, lenc);
+	    VALUE newpath = rb_str_conv_enc(path, uenc, lenc);
+	    if (newpath == path) continue;
+	    path = newpath;
 #else
 	    path = rb_enc_associate(rb_str_dup(path), lenc);
 #endif
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 55267)
+++ ChangeLog	(revision 55268)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Jun  3 21:27:22 2016  Nobuyoshi Nakada  <nobu@r...>
+
+	* ruby.c (process_options): rb_str_conv_enc() never set encoding
+	  of the source string, but returns the string itself if the
+	  conversion failed.  then the instance variable does not need to
+	  be set again.
+
 Fri Jun  3 18:04:37 2016  NAKAMURA Usaku  <usa@r...>
 
 	* ruby.c (process_options): need to duplicate path before passing it to

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

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