ruby-changes:39747
From: normal <ko1@a...>
Date: Sat, 12 Sep 2015 05:36:35 +0900 (JST)
Subject: [ruby-changes:39747] normal:r51828 (trunk): rational.c: preserve encoding in exception
normal 2015-09-12 05:36:18 +0900 (Sat, 12 Sep 2015) New Revision: 51828 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51828 Log: rational.c: preserve encoding in exception * rational.c (string_to_r_strict): preserve encoding in exception Modified files: trunk/ChangeLog trunk/rational.c Index: ChangeLog =================================================================== --- ChangeLog (revision 51827) +++ ChangeLog (revision 51828) @@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sat Sep 12 05:35:24 2015 Eric Wong <e@8...> + + * rational.c (string_to_r_strict): preserve encoding in exception + Fri Sep 11 20:23:35 2015 Koichi Sasada <ko1@a...> * vm_core.h: remove rb_call_info_t::aux.opt_pc. Index: rational.c =================================================================== --- rational.c (revision 51827) +++ rational.c (revision 51828) @@ -2327,9 +2327,8 @@ string_to_r_strict(VALUE self) https://github.com/ruby/ruby/blob/trunk/rational.c#L2327 s = (char *)""; if (!parse_rat(s, 1, &num)) { - VALUE ins = f_inspect(self); - rb_raise(rb_eArgError, "invalid value for convert(): %s", - StringValuePtr(ins)); + rb_raise(rb_eArgError, "invalid value for convert(): %+"PRIsVALUE, + self); } if (RB_TYPE_P(num, T_FLOAT)) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/