summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-08-03 19:46:34 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2020-08-03 19:46:34 +0900
commit43443d9377212844b84bc0440a8c35c4adfbb5d6 (patch)
treea4a531ee1a78ee3706f3662e3ff9143dc11d6229
parentfaed5054f8a1503b8b755ea5be8575fc8b68e110 (diff)
downloadmruby-43443d9377212844b84bc0440a8c35c4adfbb5d6.tar.gz
mruby-43443d9377212844b84bc0440a8c35c4adfbb5d6.zip
Should not decrement `count` when `PACK_FLAG_COUNT2`; fix #5057
-rw-r--r--mrbgems/mruby-pack/src/pack.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mrbgems/mruby-pack/src/pack.c b/mrbgems/mruby-pack/src/pack.c
index 3a2c3367a..8169a90b5 100644
--- a/mrbgems/mruby-pack/src/pack.c
+++ b/mrbgems/mruby-pack/src/pack.c
@@ -1302,7 +1302,7 @@ mrb_pack_pack(mrb_state *mrb, mrb_value ary)
aidx++;
break;
}
- if (count > 0) {
+ if (!(flags & PACK_FLAG_COUNT2) && count > 0) {
count--;
}
}