summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-13 03:27:37 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-13 03:27:37 +0000
commit1ae7e6b6544cf7f79cb306f715db502666538ae4 (patch)
treeb275f26458f913395c8f5ddf2d0762b1d8933888
parent771d31ace2e8fb923852cb2a70b18b3c8b4edc69 (diff)
encoding.c: new termlen not oldtermlen
* encoding.c (rb_enc_associate_index): fill new terminator length, not old one. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--encoding.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 6ee2e42e1bc..2bda0b2774b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Jul 13 12:27:34 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * encoding.c (rb_enc_associate_index): fill new terminator length, not
+ old one.
+
Sat Jul 13 12:24:24 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/win32: move from ext/dl and ext/fiddle. since ext/extmk.rb
diff --git a/encoding.c b/encoding.c
index 7c64248d121..6e0777d24c9 100644
--- a/encoding.c
+++ b/encoding.c
@@ -795,7 +795,7 @@ rb_enc_associate_index(VALUE obj, int idx)
termlen = rb_enc_mbminlen(enc);
oldtermlen = rb_enc_mbminlen(rb_enc_from_index(oldidx));
if (oldtermlen < termlen && RB_TYPE_P(obj, T_STRING)) {
- rb_str_fill_terminator(obj, oldtermlen);
+ rb_str_fill_terminator(obj, termlen);
}
enc_set_index(obj, idx);
return obj;