summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-17 03:26:21 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-17 03:26:21 +0000
commitb3626b3ee7d814e23016a4c639aa05e51fea5a8b (patch)
tree64440fac4098e288e6294b0e282512f585ab2fb4 /string.c
parentb8858232f20ac6ac1d376dd79ee0e67b485a67d0 (diff)
downloadruby-b3626b3ee7d814e23016a4c639aa05e51fea5a8b.tar.gz
string.c: expand heap
* string.c (str_buf_cat): expand the heap buffer at making str independent, not only just copying. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string.c b/string.c
index d85033ea6c..82e5a5c5a4 100644
--- a/string.c
+++ b/string.c
@@ -2194,7 +2194,7 @@ str_buf_cat(VALUE str, const char *ptr, long len)
if (ptr >= sptr && ptr <= sptr + olen) {
off = ptr - sptr;
}
- rb_str_modify(str);
+ rb_str_modify_expand(str, len);
if (len == 0) return 0;
if (STR_EMBED_P(str)) {
capa = RSTRING_EMBED_LEN_MAX;