diff --git a/ChangeLog b/ChangeLog index 3f7b221128..b4992cd534 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Mar 2 14:06:01 2011 NARUSE, Yui + + * string.c (rb_str_slice_bang): move treatments which is only needed + when the result is not nil. + Wed Mar 2 14:02:29 2011 Shota Fukumori * test/testunit/test_parallel.rb(TestParallel#spawn_runner): diff --git a/string.c b/string.c index 87273de5f1..bb13bd1d8d 100644 --- a/string.c +++ b/string.c @@ -3503,10 +3503,10 @@ rb_str_slice_bang(int argc, VALUE *argv, VALUE str) for (i=0; i "e" * "hello".byteslice(-1) #=> "o" * "hello".byteslice(1, 2) #=> "el" - * "\u3042".byteslice(1, 2) #=> "\x81\x82" - * "\u3042".byteslice(1..3) #=> "\x81\x82" + * "\x80\u3042".byteslice(1, 3) #=> "\u3042" + * "\x03\u3042\xff".byteslice(1..3) #=> "\u3942" */ static VALUE