From f4c58a0c3725623aefe2f8031695dd52e6b6fac8 Mon Sep 17 00:00:00 2001 From: yugui Date: Fri, 12 Dec 2008 14:53:58 +0000 Subject: merges r20581 from trunk into ruby_1_9_1. * pack.c (pack_pack): fixed odd act of 'm*', 'M*', and 'P*'. just ignores '*' in these cases. [ruby-dev:37289] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@20673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ pack.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f94a91282..0297287b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Dec 8 23:34:18 2008 Yuki Sonoda (Yugui) + + * pack.c (pack_pack): fixed odd act of 'm*', 'M*', and 'P*'. + just ignores '*' in these cases. + [ruby-dev:37289] + Mon Dec 8 18:31:41 2008 Nobuyoshi Nakada * pack.c (pack_pack): fixed length for odd length string. diff --git a/pack.c b/pack.c index 3f20d53c5..8c02f6256 100644 --- a/pack.c +++ b/pack.c @@ -491,7 +491,9 @@ pack_pack(VALUE ary, VALUE fmt) } } if (*p == '*') { /* set data length */ - len = strchr("@Xxu", type) ? 0 : items; + len = strchr("@Xxu", type) ? 0 + : strchr("PMm", type) ? 1 + : items; p++; } else if (ISDIGIT(*p)) { -- cgit