diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-02-25 08:10:23 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-02-25 08:10:23 +0000 |
commit | f7f7f93a03f013fb957a0e3e99237f16b5bc1fef (patch) | |
tree | bf659f16ad0a53f078185e0b19d388f3b4ee96c7 /dir.c | |
parent | 7e2e3dc85d8c02672bc7486630424e7df95ef28b (diff) |
merge revision(s) 34795:
* dir.c (dir_inspect), io.c (rb_io_inspect): keep encoding of path.
[Bug #6072]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r-- | dir.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -486,8 +486,12 @@ dir_inspect(VALUE dir) TypedData_Get_Struct(dir, struct dir_data, &dir_data_type, dirp); if (!NIL_P(dirp->path)) { - const char *c = rb_obj_classname(dir); - return rb_sprintf("#<%s:%s>", c, RSTRING_PTR(dirp->path)); + VALUE str = rb_str_new_cstr("#<"); + rb_str_append(str, rb_class_name(CLASS_OF(dir))); + rb_str_cat2(str, ":"); + rb_str_append(str, dirp->path); + rb_str_cat2(str, ">"); + return str; } return rb_funcall(dir, rb_intern("to_s"), 0, 0); } |