ruby-changes:29041
From: knu <ko1@a...>
Date: Thu, 6 Jun 2013 00:06:02 +0900 (JST)
Subject: [ruby-changes:29041] knu:r41092 (trunk): * string.c (String#b): Allow code range scan to happen later so
knu 2013-06-06 00:05:48 +0900 (Thu, 06 Jun 2013) New Revision: 41092 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41092 Log: * string.c (String#b): Allow code range scan to happen later so ascii_only? on a result string returns the correct value. [ruby-core:55315] [Bug #8496] Modified files: trunk/ChangeLog trunk/string.c trunk/test/ruby/test_m17n.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 41091) +++ ChangeLog (revision 41092) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Jun 6 00:05:08 2013 Akinori MUSHA <knu@i...> + + * string.c (String#b): Allow code range scan to happen later so + ascii_only? on a result string returns the correct value. + [ruby-core:55315] [Bug #8496] + Wed Jun 5 22:40:42 2013 Shugo Maeda <shugo@r...> * lib/net/imap.rb (capability_response): should ignore trailing Index: string.c =================================================================== --- string.c (revision 41091) +++ string.c (revision 41092) @@ -7624,7 +7624,7 @@ rb_str_b(VALUE str) https://github.com/ruby/ruby/blob/trunk/string.c#L7624 VALUE str2 = str_alloc(rb_cString); str_replace_shared_without_enc(str2, str); OBJ_INFECT(str2, str); - ENC_CODERANGE_SET(str2, ENC_CODERANGE_VALID); + ENC_CODERANGE_CLEAR(str2); return str2; } Index: test/ruby/test_m17n.rb =================================================================== --- test/ruby/test_m17n.rb (revision 41091) +++ test/ruby/test_m17n.rb (revision 41092) @@ -1488,6 +1488,8 @@ class TestM17N < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_m17n.rb#L1488 assert_equal(true, s.b.tainted?) s.untrust assert_equal(true, s.b.untrusted?) + s = "abc".b + assert_equal(true, s.b.ascii_only?) end def test_scrub -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/