summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-29 17:34:43 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-29 17:34:43 +0000
commit7d49e2bfc192126287fea10c2205822a98d128f1 (patch)
tree475fbaeeddfb540b59e25cdb49d1cf3de6d776ec /io.c
parent4c5d8bebe80e90236bfe919efe67130e97824868 (diff)
merge revision(s) r45979: [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_1@46614 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 6e3fd85d2b..6deb44187f 100644
--- a/io.c
+++ b/io.c
@@ -2290,8 +2290,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;