summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-28 05:55:05 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-28 05:55:05 +0000
commit20da239464cc91e921cbb98d903d29622919fdcd (patch)
treee9f2232b4834dc1e83e7371be28eafab55778e44 /io.c
parentc4ad649e070dcb1011747d30cee084520bd79a70 (diff)
io.c: preserve encodings
* io.c (rb_io_s_new): preserve encodings in warning messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/io.c b/io.c
index 81d35fd862..7dc1c8956c 100644
--- a/io.c
+++ b/io.c
@@ -7618,9 +7618,9 @@ static VALUE
rb_io_s_new(int argc, VALUE *argv, VALUE klass)
{
if (rb_block_given_p()) {
- const char *cname = rb_class2name(klass);
+ VALUE cname = rb_obj_as_string(klass);
- rb_warn("%s::new() does not take block; use %s::open() instead",
+ rb_warn("%"PRIsVALUE"::new() does not take block; use %"PRIsVALUE"::open() instead",
cname, cname);
}
return rb_class_new_instance(argc, argv, klass);