ruby-changes:9132
From: yugui <ko1@a...>
Date: Fri, 12 Dec 2008 23:53:43 +0900 (JST)
Subject: [ruby-changes:9132] Ruby:r20669 (ruby_1_9_1): merges r20564 from trunk into ruby_1_9_1.
yugui 2008-12-12 23:53:16 +0900 (Fri, 12 Dec 2008) New Revision: 20669 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20669 Log: merges r20564 from trunk into ruby_1_9_1. * pack.c (pack_pack): 'u0' is not special differently from 'm0'. Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/pack.c branches/ruby_1_9_1/test/ruby/test_pack.rb Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 20668) +++ ruby_1_9_1/ChangeLog (revision 20669) @@ -1,3 +1,7 @@ +Sat Dec 6 17:51:35 2008 Yuki Sonoda (Yugui) <yugui@y...> + + * pack.c (pack_pack): 'u0' is not special differently from 'm0'. + Tue Dec 9 11:50:46 2008 Yuki Sonoda (Yugui) <yugui@y...> * pack.c (pack_pck): fixed [ruby-dev:37295]. Index: ruby_1_9_1/pack.c =================================================================== --- ruby_1_9_1/pack.c (revision 20668) +++ ruby_1_9_1/pack.c (revision 20669) @@ -903,7 +903,7 @@ ptr = RSTRING_PTR(from); plen = RSTRING_LEN(from); - if (len == 0) { + if (len == 0 && type == 'm') { encodes(res, ptr, plen, type, 0); ptr += plen; break; Index: ruby_1_9_1/test/ruby/test_pack.rb =================================================================== --- ruby_1_9_1/test/ruby/test_pack.rb (revision 20668) +++ ruby_1_9_1/test/ruby/test_pack.rb (revision 20669) @@ -349,6 +349,10 @@ assert_equal("M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A\n!80``\n", ["a"*46].pack("u")) assert_equal("&86)C9&5F\n#9VAI\n", ["abcdefghi"].pack("u6")) + assert_equal("M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A\n!80``\n", ["a"*46].pack("u0")) + assert_equal("M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A\n!80``\n", ["a"*46].pack("u1")) + assert_equal("M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A\n!80``\n", ["a"*46].pack("u2")) + assert_equal([""], "".unpack("u")) assert_equal(["a"], "!80``\n".unpack("u")) assert_equal(["abc"], "#86)C\n".unpack("u")) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/