From 2cbdeacdc8f0fb3f4252c72a24407afba5788a6b Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sat, 28 Feb 2004 10:55:05 +0000 Subject: [PATCH] `buckettools -c' now uses fastbufs for output. --- lib/buckettool.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/buckettool.c b/lib/buckettool.c index 886bd41b..179e3d98 100644 --- a/lib/buckettool.c +++ b/lib/buckettool.c @@ -141,23 +141,25 @@ static void cat(void) { struct obuck_header h; - struct fastbuf *b; + struct fastbuf *b, *out; byte buf[1024]; int l, lf; obuck_init(0); + out = bfdopen_shared(1, 65536); while (b = obuck_slurp_pool(&h)) { - printf("### %08x %6d %08x\n", h.oid, h.length, h.type); + bprintf(out, "### %08x %6d %08x\n", h.oid, h.length, h.type); lf = 1; while ((l = bread(b, buf, sizeof(buf)))) { - fwrite(buf, 1, l, stdout); + bwrite(out, buf, l); lf = (buf[l-1] == '\n'); } if (!lf) - printf("\n# \n"); + bprintf(out, "\n# \n"); } + bclose(out); obuck_cleanup(); } -- 2.39.2