X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fbuckettool.c;h=bc8ce32d10ceca1cca491ecea404c6807c264ffe;hb=0c53af3db5fdca461f49998194ecbfd8f55b7a8a;hp=ae55b3ca4d4f92c784c25bae194ac3c0fae308fd;hpb=3b0d474dd52fab80a5adca3b4b82c2db47a88657;p=libucw.git diff --git a/lib/buckettool.c b/lib/buckettool.c index ae55b3ca..bc8ce32d 100644 --- a/lib/buckettool.c +++ b/lib/buckettool.c @@ -135,22 +135,18 @@ cat(void) int l, lf; obuck_init(0); - if (obuck_find_first(&h, 0)) - do - { - printf("### %08x %6d %6d\n", h.oid, h.length, h.orig_length); - b = obuck_fetch(); - lf = 1; - while ((l = bread(b, buf, sizeof(buf)))) - { - fwrite(buf, 1, l, stdout); - lf = (buf[l-1] == '\n'); - } - obuck_fetch_end(b); - if (!lf) - printf("\n# \n"); - } - while (obuck_find_next(&h, 0)); + while (b = obuck_slurp_pool(&h)) + { + printf("### %08x %6d %6d\n", h.oid, h.length, h.orig_length); + lf = 1; + while ((l = bread(b, buf, sizeof(buf)))) + { + fwrite(buf, 1, l, stdout); + lf = (buf[l-1] == '\n'); + } + if (!lf) + printf("\n# \n"); + } obuck_cleanup(); }