summaryrefslogtreecommitdiff
path: root/range.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-04-10 05:48:43 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-04-10 05:48:43 +0000
commit7194267b3bdf68ad75bd6bee8e7c6377f7b0ea2f (patch)
tree6dcd08ef584fc777cf34517136d5ce3948840e45 /range.c
parentbe72d9a5da9be284d2bdb8047e50f14e014b7835 (diff)
2000-04-10
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'range.c')
-rw-r--r--range.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/range.c b/range.c
index bbb2412..971c596 100644
--- a/range.c
+++ b/range.c
@@ -256,8 +256,10 @@ range_to_s(range)
str = rb_obj_as_string(rb_ivar_get(range, id_beg));
str2 = rb_obj_as_string(rb_ivar_get(range, id_end));
+ str = rb_str_dup(str);
rb_str_cat(str, "...", EXCL(range)?3:2);
- rb_str_cat(str, RSTRING(str2)->ptr, RSTRING(str2)->len);
+ rb_str_append(str, str2);
+ OBJ_INFECT(str, str2);
return str;
}
@@ -270,8 +272,10 @@ range_inspect(range)
str = rb_inspect(rb_ivar_get(range, id_beg));
str2 = rb_inspect(rb_ivar_get(range, id_end));
+ str = rb_str_dup(str);
rb_str_cat(str, "...", EXCL(range)?3:2);
- rb_str_cat(str, RSTRING(str2)->ptr, RSTRING(str2)->len);
+ rb_str_append(str, str2);
+ OBJ_INFECT(str, str2);
return str;
}