summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-30 02:33:38 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-30 02:33:38 +0000
commit950508e9b73543c4ec1846b3b7887613e9defc20 (patch)
tree06323c8c9b41a7e33eeb99e6c1fa113f116303bc /string.c
parent361978beb23c00670679252bd9a0f8f9720e618d (diff)
string.c: reset code range
* string.c (rb_str_substr): need to reset code range for shared string too, not only copied string. [ruby-core:62842] [Bug #9882] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string.c b/string.c
index c093433736..15e6bcd623 100644
--- a/string.c
+++ b/string.c
@@ -1894,10 +1894,10 @@ rb_str_substr(VALUE str, long beg, long len)
}
else {
str2 = rb_str_new_with_class(str, p, len);
- rb_enc_cr_str_copy_for_substr(str2, str);
OBJ_INFECT(str2, str);
RB_GC_GUARD(str);
}
+ rb_enc_cr_str_copy_for_substr(str2, str);
return str2;
}