diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-29 17:34:43 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-29 17:34:43 +0000 |
commit | 7d49e2bfc192126287fea10c2205822a98d128f1 (patch) | |
tree | 475fbaeeddfb540b59e25cdb49d1cf3de6d776ec /io.c | |
parent | 4c5d8bebe80e90236bfe919efe67130e97824868 (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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |