diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-03-29 12:56:40 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-03-29 12:56:40 +0000 |
commit | a64103fbfe0218dcd6f1997e80c60a887897a52d (patch) | |
tree | 5e574e984eb419247a1a08c9d033211061c57ead | |
parent | d084c4f43d975f1f9b3f7bf12a46506dbbea2a2d (diff) | |
download | ruby-a64103fbfe0218dcd6f1997e80c60a887897a52d.tar.gz |
* string.c (rb_String): Kernel#String should call to_str before to_s.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | object.c | 5 |
2 files changed, 8 insertions, 1 deletions
@@ -1,3 +1,7 @@ +Tue Mar 29 21:51:31 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com> + + * string.c (rb_String): Kernel#String should call to_str before to_s. + Tue Mar 29 10:28:08 2011 NAKAMURA Usaku <usa@ruby-lang.org> * test/webrick/test_filehandler.rb @@ -2360,7 +2360,10 @@ rb_num2dbl(VALUE val) VALUE rb_String(VALUE val) { - return rb_convert_type(val, T_STRING, "String", "to_s"); + VALUE tmp = rb_check_string_type(val); + if (NIL_P(tmp)) + tmp = rb_convert_type(val, T_STRING, "String", "to_s"); + return tmp; } |