ruby-changes:4081
From: ko1@a...
Date: Fri, 22 Feb 2008 11:18:56 +0900 (JST)
Subject: [ruby-changes:4081] naruse - Ruby:r15571 (trunk): * string.c (rb_str_substr): copy encoding although empty string.
naruse 2008-02-22 11:18:23 +0900 (Fri, 22 Feb 2008)
New Revision: 15571
Modified files:
trunk/ChangeLog
trunk/string.c
Log:
* string.c (rb_str_substr): copy encoding although empty string.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/string.c?r1=15571&r2=15570&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=15571&r2=15570&diff_format=u
Index: ChangeLog
===================================================================
--- ChangeLog (revision 15570)
+++ ChangeLog (revision 15571)
@@ -1,3 +1,7 @@
+Fri Feb 22 11:16:55 2008 NARUSE, Yui <naruse@r...>
+
+ * string.c (rb_str_substr): copy encoding although empty string.
+
Fri Feb 22 04:48:22 2008 NARUSE, Yui <naruse@r...>
* string.c (rb_str_times): empty string's coderange is CODERANGE_7BIT.
Index: string.c
===================================================================
--- string.c (revision 15570)
+++ string.c (revision 15571)
@@ -1242,7 +1242,10 @@
else {
str2 = rb_str_new5(str, p, len);
if (len) rb_enc_cr_str_copy(str2, str);
- else ENC_CODERANGE_SET(str2, ENC_CODERANGE_7BIT);
+ else {
+ rb_enc_copy(str2, str);
+ ENC_CODERANGE_SET(str2, ENC_CODERANGE_7BIT);
+ }
OBJ_INFECT(str2, str);
}
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/