ruby-changes:8121
From: matz <ko1@a...>
Date: Wed, 1 Oct 2008 01:19:47 +0900 (JST)
Subject: [ruby-changes:8121] Ruby:r19649 (trunk): * string.c (rb_str_split_m): should use rb_str_subseq() which use
matz 2008-10-01 01:18:27 +0900 (Wed, 01 Oct 2008) New Revision: 19649 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19649 Log: * string.c (rb_str_split_m): should use rb_str_subseq() which use offset and length by bytes. [ruby-dev:36641] Modified files: trunk/ChangeLog trunk/string.c Index: ChangeLog =================================================================== --- ChangeLog (revision 19648) +++ ChangeLog (revision 19649) @@ -1,3 +1,8 @@ +Wed Oct 1 00:54:32 2008 Yukihiro Matsumoto <matz@r...> + + * string.c (rb_str_split_m): should use rb_str_subseq() which use + offset and length by bytes. [ruby-dev:36641] + Wed Oct 1 00:29:48 2008 Yusuke Endoh <mame@t...> * test/ruby/test_settracefunc.rb (test_call, test_class): line number Index: string.c =================================================================== --- string.c (revision 19648) +++ string.c (revision 19649) @@ -5148,7 +5148,7 @@ spat = rb_reg_regcomp(spat); split_type = regexp; } - else if (rb_enc_mbminlen(enc2) == 1) { + else if (rb_enc_asciicompat(enc2) == 1) { if (RSTRING_LEN(spat) == 1 && RSTRING_PTR(spat)[0] == ' '){ split_type = awk; } @@ -5224,7 +5224,7 @@ ptr = t; continue; } - rb_ary_push(result, rb_str_substr(str, ptr - RSTRING_PTR(str), end)); + rb_ary_push(result, rb_str_subseq(str, ptr - RSTRING_PTR(str), end)); ptr += end + slen; if (!NIL_P(limit) && lim <= ++i) break; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/