[macruby-changes] [5174] MacRuby/trunk/pack.c
source_changes at macosforge.org
source_changes at macosforge.org
Sun Jan 16 00:05:54 PST 2011
Revision: 5174
http://trac.macosforge.org/projects/ruby/changeset/5174
Author: watson1978 at gmail.com
Date: 2011-01-16 00:05:45 -0800 (Sun, 16 Jan 2011)
Log Message:
-----------
String#unpack with format 'Q' will add nil for each element requested beyond the end of the String.
Test Script:
{{{
require 'test/unit/assertions.rb'
include Test::Unit::Assertions
assert_equal([nil], "".unpack("Q"))
assert_equal([nil, nil], "".unpack("Q2"))
puts :ok
}}}
Modified Paths:
--------------
MacRuby/trunk/pack.c
Modified: MacRuby/trunk/pack.c
===================================================================
--- MacRuby/trunk/pack.c 2011-01-16 02:09:42 UTC (rev 5173)
+++ MacRuby/trunk/pack.c 2011-01-16 08:05:45 UTC (rev 5174)
@@ -1666,6 +1666,7 @@
s += QUAD_SIZE;
UNPACK_PUSH(rb_quad_unpack(tmp, 0));
}
+ PACK_ITEM_ADJUST();
break;
case 'n':
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20110116/5ffdfbec/attachment-0001.html>
More information about the macruby-changes
mailing list