summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--string.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ce180ebc3f..94ad482142 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Aug 4 19:37:00 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_set_len): rb_str_modify cannot work before the
+ length is set, which is a precondition for rb_str_modify.
+
Wed Aug 4 16:09:43 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* string.c (rb_str_resize): should copy the content properly. a
diff --git a/string.c b/string.c
index 6d8b606c11..decc9d7f04 100644
--- a/string.c
+++ b/string.c
@@ -1692,7 +1692,7 @@ rb_str_unlocktmp(VALUE str)
void
rb_str_set_len(VALUE str, long len)
{
- rb_str_modify(str);
+ str_modifiable(str);
STR_SET_LEN(str, len);
RSTRING_PTR(str)[len] = '\0';
}