[前][次][番号順一覧][スレッド一覧]

ruby-changes:14844

From: akr <ko1@a...>
Date: Fri, 19 Feb 2010 00:25:24 +0900 (JST)
Subject: [ruby-changes:14844] Ruby:r26710 (ruby_1_8): * pack.c (pack_unpack): call PACK_ITEM_ADJUST for 'Q'.

akr	2010-02-19 00:25:10 +0900 (Fri, 19 Feb 2010)

  New Revision: 26710

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26710

  Log:
    * pack.c (pack_unpack): call PACK_ITEM_ADJUST for 'Q'.

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/pack.c
    branches/ruby_1_8/test/ruby/test_pack.rb

Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 26709)
+++ ruby_1_8/ChangeLog	(revision 26710)
@@ -1,3 +1,7 @@
+Fri Feb 19 00:23:24 2010  Tanaka Akira  <akr@f...>
+
+	* pack.c (pack_unpack): call PACK_ITEM_ADJUST for 'Q'.
+	
 Tue Feb 16 20:56:39 2010  Tanaka Akira  <akr@f...>
 
 	* file.c (rb_group_member): renamed from group_member.
Index: ruby_1_8/pack.c
===================================================================
--- ruby_1_8/pack.c	(revision 26709)
+++ ruby_1_8/pack.c	(revision 26710)
@@ -1592,6 +1592,7 @@
 		s += QUAD_SIZE;
 		rb_ary_push(ary, rb_quad_unpack(tmp, 0));
 	    }
+	    PACK_ITEM_ADJUST();
 	    break;
 
 	  case 'n':
Index: ruby_1_8/test/ruby/test_pack.rb
===================================================================
--- ruby_1_8/test/ruby/test_pack.rb	(revision 26709)
+++ ruby_1_8/test/ruby/test_pack.rb	(revision 26710)
@@ -97,4 +97,11 @@
     assert_equal(["10ef"], "\x10\xef".unpack("H4"))
     assert_equal(["10ef"], "\x10\xef".unpack("H5"))
   end
+
+  def test_short_string
+    %w[n N v V s S l L q Q].each {|fmt|
+      str = [1].pack(fmt)
+      assert_equal([1,nil], str.unpack("#{fmt}2"))
+    }
+  end
 end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]