Bug: forgotten character progress while checksumming over partial b or B
format.

In both, no checksum:
perl -wle 'print for unpack("b10a", "abcd")'
1000011001
c

With checksum:
Before:
perl -wle 'print for unpack("%b10a", "abcd")'
4
b

After:
./perl -Ilib -wle 'print for unpack("%b10a", "abcd")'
4
c

Patch relative to 5.8.6:

--- pp_pack.c.old       Sat Jan 29 13:26:27 2005
+++ pp_pack.c   Sat Jan 29 13:28:45 2005
@@ -712,7 +712,7 @@
                    len -= 8;
                }
                if (len) {
-                   bits = *s;
+                   bits = *s++;
                    if (datumtype == 'b') {
                        while (len-- > 0) {
                            if (bits & 1) cuv++;

Reply via email to