diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-02-15 08:45:15 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-02-15 08:45:15 +0000 |
commit | 7eed0ca619fc7602737bb81d42a63dc60751367b (patch) | |
tree | 64ea801639425b403411c3a045b60311a26e95fd /io.c | |
parent | ff4c13688ec7f4ea212fadf16c6ad7c4d9f5ba11 (diff) | |
download | ruby-7eed0ca619fc7602737bb81d42a63dc60751367b.tar.gz |
* io.c (io_strsetbuf): call rb_str_modify to make str independent
before calling rb_str_set_len for r34580.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -2084,7 +2084,10 @@ io_setstrbuf(VALUE *str, long len) VALUE s = StringValue(*str); long clen = RSTRING_LEN(s); if (clen >= len) { - if (clen != len) rb_str_set_len(s, len); + if (clen != len) { + rb_str_modify(s); + rb_str_set_len(s, len); + } return; } len -= clen; |