summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-20 13:22:32 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-20 13:22:32 +0000
commit139ab718de87af8ca9a3c83da9ca4f59c9cdb7e8 (patch)
tree96187af972cf192cff805bfeae67f9f936a69f5a
parent79128855ab1c2cae7fe95b60f89e7bd176f02cc8 (diff)
merges r29804 from trunk into ruby_1_9_2.
-- * pack.c (PACK_ITEM_ADJUST): return nil not result array and yield values if block is given. [ruby-core:33193] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--pack.c2
-rw-r--r--test/ruby/test_pack.rb7
-rw-r--r--version.h2
4 files changed, 14 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 1b36f6d6ac..3bdc6c15c8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Nov 16 06:39:31 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * pack.c (PACK_ITEM_ADJUST): return nil not result array and yield
+ values if block is given. [ruby-core:33193]
+
Tue Nov 16 00:21:20 2010 Yusuke Endoh <mame@tsg.ne.jp>
* regparse.c (and_cclass, or_cclass): fix memory leak. Coverity Scan
diff --git a/pack.c b/pack.c
index be42c6293e..d659266a41 100644
--- a/pack.c
+++ b/pack.c
@@ -1189,7 +1189,7 @@ hex2num(char c)
} while (0)
#define PACK_ITEM_ADJUST() do { \
- if (tmp_len > 0) \
+ if (tmp_len > 0 && !block_p) \
rb_ary_store(ary, RARRAY_LEN(ary)+tmp_len-1, Qnil); \
} while (0)
diff --git a/test/ruby/test_pack.rb b/test/ruby/test_pack.rb
index a4a6308299..8fa0a90915 100644
--- a/test/ruby/test_pack.rb
+++ b/test/ruby/test_pack.rb
@@ -615,4 +615,11 @@ class TestPack < Test::Unit::TestCase
assert_equal([1,nil], str.unpack("#{fmt}2"))
}
end
+
+ def test_short_with_block
+ bug4059 = '[ruby-core:33193]'
+ result = :ok
+ assert_nil("".unpack("i") {|x| result = x}, bug4059)
+ assert_equal(:ok, result)
+ end
end
diff --git a/version.h b/version.h
index f9c6ec2899..6d23a88eeb 100644
--- a/version.h
+++ b/version.h
@@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.2"
-#define RUBY_PATCHLEVEL 97
+#define RUBY_PATCHLEVEL 98
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 9
#define RUBY_VERSION_TEENY 1