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

ruby-changes:26531

From: nobu <ko1@a...>
Date: Tue, 25 Dec 2012 00:58:03 +0900 (JST)
Subject: [ruby-changes:26531] nobu:r38582 (trunk): error.c: VALUE to messages

nobu	2012-12-25 00:57:51 +0900 (Tue, 25 Dec 2012)

  New Revision: 38582

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

  Log:
    error.c: VALUE to messages
    
    * error.c (name_err_mesg_to_str, syserr_initialize): use VALUE to
      format messages.

  Modified files:
    trunk/error.c

Index: error.c
===================================================================
--- error.c	(revision 38581)
+++ error.c	(revision 38582)
@@ -1097,7 +1097,7 @@ name_err_mesg_to_str(VALUE obj) https://github.com/ruby/ruby/blob/trunk/error.c#L1097
 	if (desc && desc[0] != '#') {
 	    d = d ? rb_str_dup(d) : rb_str_new2(desc);
 	    rb_str_cat2(d, ":");
-	    rb_str_cat2(d, rb_obj_classname(obj));
+	    rb_str_append(d, rb_class_name(CLASS_OF(obj)));
 	}
 	args[0] = mesg;
 	args[1] = ptr[2];
@@ -1246,8 +1246,7 @@ syserr_initialize(int argc, VALUE *argv, https://github.com/ruby/ruby/blob/trunk/error.c#L1246
 	VALUE str = StringValue(mesg);
 	rb_encoding *me = rb_enc_get(mesg);
 
-	mesg = rb_sprintf("%s - %.*s", err,
-			  (int)RSTRING_LEN(str), RSTRING_PTR(str));
+	mesg = rb_sprintf("%s - %"PRIsVALUE, err, mesg);
 	if (le != me && rb_enc_asciicompat(me)) {
 	    le = me;
 	}/* else assume err is non ASCII string. */

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

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