shithub: mc

Download patch

ref: e2af21dfac347768c8f87d84475ca00dc7d8cbe5
parent: 1441fb3b590d17f08cd3d4bc19abfd6b92e85b98
author: Ori Bernstein <[email protected]>
date: Sun Jun 17 20:07:01 EDT 2012

Make bscount() count properly.

    For some reason, the count started from the first bit? wtf?

--- a/parse/bitset.c
+++ b/parse/bitset.c
@@ -67,7 +67,7 @@
 
     n = 0;
     for (i = 0; i < bs->nchunks; i++)
-        for (j = 1; j < sizeof(size_t)*CHAR_BIT; j++)
+        for (j = 0; j < sizeof(size_t)*CHAR_BIT; j++)
             if (bs->chunks[i] & 1ULL << j)
                 n++;
     return n;