summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-27 08:22:17 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-27 08:22:17 +0000
commit322b26795583a0b854e7b195e7f766bd479c0404 (patch)
tree031edd791b725b9fb8a343fb083aa26eb70b4ae7 /io.c
parent674b2526650f317a5a836130631651dbdb019913 (diff)
merge revision(s) 45979: [Backport #9847]
* io.c (io_setstrbuf): always check if the buffer is modifiable. [ruby-core:62643] [Bug #9847] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@46580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io.c b/io.c
index 9940bc6e2a..d676bb1979 100644
--- a/io.c
+++ b/io.c
@@ -2253,8 +2253,8 @@ io_setstrbuf(VALUE *str, long len)
VALUE s = StringValue(*str);
long clen = RSTRING_LEN(s);
if (clen >= len) {
+ rb_str_modify(s);
if (clen != len) {
- rb_str_modify(s);
rb_str_set_len(s, len);
}
return;