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

ruby-changes:29914

From: nobu <ko1@a...>
Date: Mon, 15 Jul 2013 02:21:51 +0900 (JST)
Subject: [ruby-changes:29914] nobu:r41965 (trunk): encoding.c: encoding at inspect

nobu	2013-07-15 02:21:36 +0900 (Mon, 15 Jul 2013)

  New Revision: 41965

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

  Log:
    encoding.c: encoding at inspect
    
    * encoding.c (enc_inspect): use PRIsVALUE to preserve the result
      encoding.

  Modified files:
    trunk/ChangeLog
    trunk/encoding.c

Index: encoding.c
===================================================================
--- encoding.c	(revision 41964)
+++ encoding.c	(revision 41965)
@@ -1023,11 +1023,10 @@ rb_enc_tolower(int c, rb_encoding *enc) https://github.com/ruby/ruby/blob/trunk/encoding.c#L1023
 static VALUE
 enc_inspect(VALUE self)
 {
-    VALUE str = rb_sprintf("#<%s:%s%s>", rb_obj_classname(self),
-		      rb_enc_name((rb_encoding*)DATA_PTR(self)),
-		      (enc_dummy_p(self) ? " (dummy)" : ""));
-    ENCODING_CODERANGE_SET(str, ENCINDEX_US_ASCII, ENC_CODERANGE_7BIT);
-    return str;
+    return rb_enc_sprintf(rb_usascii_encoding(),
+			  "#<%"PRIsVALUE":%s%s>", rb_obj_class(self),
+			  rb_enc_name((rb_encoding*)DATA_PTR(self)),
+			  (enc_dummy_p(self) ? " (dummy)" : ""));
 }
 
 /*
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41964)
+++ ChangeLog	(revision 41965)
@@ -1,4 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
-Mon Jul 15 02:21:29 2013  Nobuyoshi Nakada  <nobu@r...>
+Mon Jul 15 02:21:33 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* encoding.c (enc_inspect): use PRIsVALUE to preserve the result
+	  encoding.
 
 	* encoding.c (enc_set_index): deal with terminator so that
 	  rb_enc_set_index also works.

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

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