summaryrefslogtreecommitdiffstats
path: root/struct.c
diff options
context:
space:
mode:
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/struct.c b/struct.c
index 778a0d7a6..188910be4 100644
--- a/struct.c
+++ b/struct.c
@@ -442,7 +442,12 @@ inspect_struct(VALUE s, VALUE dummy, int recur)
}
members = rb_struct_members(s);
- str = rb_sprintf("#<struct %s ", cname);
+ if (cname[0] == '#') {
+ str = rb_str_new2("#<struct ");
+ }
+ else {
+ str = rb_sprintf("#<struct %s ", cname);
+ }
for (i=0; i<RSTRUCT_LEN(s); i++) {
VALUE slot;
ID id;