summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ext/stringio/stringio.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 6f9a67bb0eb..261d426c90d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index d15db8b0766..57854919cd6 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -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);