1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

stringio.c: keep coderange

* ext/stringio/stringio.c (strio_write): keep coderange of
  ptr->string.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-07-01 06:04:23 +00:00
parent 78b45a0bc0
commit 8776802385
2 changed files with 5 additions and 2 deletions

View file

@ -1,4 +1,7 @@
Mon Jul 1 15:03:42 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
Mon Jul 1 15:04:20 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/stringio/stringio.c (strio_write): keep coderange of
ptr->string.
* string.c (rb_enc_cr_str_buf_cat, rb_str_append): consider an empty
string 7bit-clean and should not discard cached coderange of string

View file

@ -1182,7 +1182,7 @@ strio_write(VALUE self, VALUE str)
ptr->pos = olen;
}
if (ptr->pos == olen) {
rb_str_cat(ptr->string, RSTRING_PTR(str), len);
rb_enc_str_buf_cat(ptr->string, RSTRING_PTR(str), len, enc);
}
else {
strio_extend(ptr, ptr->pos, len);