summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-08 14:41:44 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-08 14:41:44 +0000
commit4ff58a14ce9b458ea9ef9988194ca2a2c7e4a38f (patch)
tree404b4de88e862f963ac49e1ff01d2ce11e09cfda
parent8469a17ed75f506ac0499e34f316ec0f125864be (diff)
downloadruby-4ff58a14ce9b458ea9ef9988194ca2a2c7e4a38f.tar.gz
ruby-4ff58a14ce9b458ea9ef9988194ca2a2c7e4a38f.tar.xz
ruby-4ff58a14ce9b458ea9ef9988194ca2a2c7e4a38f.zip
* 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/trunk@20581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--pack.c4
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 829e3e5fd..37a16a91f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon Dec 8 23:34:18 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * 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 <nobu@ruby-lang.org>
* pack.c (pack_pack): fixed length for odd length string.
diff --git a/pack.c b/pack.c
index f353d67c8..d910546a5 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)) {