]> mj.ucw.cz Git - libucw.git/commitdiff
Made `buckettool -x' show the header if in verbose mode.
authorMartin Mares <mj@ucw.cz>
Sun, 15 Aug 2004 10:16:03 +0000 (10:16 +0000)
committerMartin Mares <mj@ucw.cz>
Sun, 15 Aug 2004 10:16:03 +0000 (10:16 +0000)
Also use bbcopy_slow() for copying bucket contents.

lib/buckettool.c

index a5ac300861bad5d42adfb3f95d3928336c7a63b9..396138af41c1a89808c569c32ff8d35c7f153b03 100644 (file)
@@ -120,20 +120,17 @@ static void
 extract(char *id)
 {
   struct fastbuf *b, *out;
-  byte buf[1024];
-  int l;
   struct obuck_header h;
 
   h.oid = parse_id(id);
   obuck_init(0);
   obuck_find_by_oid(&h);
   out = bfdopen_shared(1, 65536);
+  if (verbose)
+    bprintf(out, "### %08x %6d %08x\n", h.oid, h.length, h.type);
   b = obuck_fetch();
   if (h.type < BUCKET_TYPE_V33 || !buck_buf)
-  {
-    while ((l = bread(b, buf, sizeof(buf))))
-      bwrite(out, buf, l);
-  }
+    bbcopy_slow(b, out, ~0U);
   else
     dump_parsed_bucket(out, &h, b);
   bclose(b);