ruby-changes:29669
From: nobu <ko1@a...>
Date: Mon, 1 Jul 2013 15:04:55 +0900 (JST)
Subject: [ruby-changes:29669] nobu:r41721 (trunk): stringio.c: keep coderange
nobu 2013-07-01 15:04:23 +0900 (Mon, 01 Jul 2013) New Revision: 41721 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41721 Log: stringio.c: keep coderange * ext/stringio/stringio.c (strio_write): keep coderange of ptr->string. Modified files: trunk/ChangeLog trunk/ext/stringio/stringio.c Index: ChangeLog =================================================================== --- ChangeLog (revision 41720) +++ ChangeLog (revision 41721) @@ -1,4 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 -Mon Jul 1 15:03:42 2013 Nobuyoshi Nakada <nobu@r...> +Mon Jul 1 15:04:20 2013 Nobuyoshi Nakada <nobu@r...> + + * 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 Index: ext/stringio/stringio.c =================================================================== --- ext/stringio/stringio.c (revision 41720) +++ ext/stringio/stringio.c (revision 41721) @@ -1182,7 +1182,7 @@ strio_write(VALUE self, VALUE str) https://github.com/ruby/ruby/blob/trunk/ext/stringio/stringio.c#L1182 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); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/