X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fbuckettool.c;h=4b7847a566a49ec7341807c724eb062686492fd2;hb=beac4661ae8230dd1747cb4ebbfddc016183b140;hp=81b252f8eed6538cd6955eeae79cef735e9842eb;hpb=95d43aff618ef84172e8893bae7727b496865007;p=libucw.git diff --git a/lib/buckettool.c b/lib/buckettool.c index 81b252f8..4b7847a5 100644 --- a/lib/buckettool.c +++ b/lib/buckettool.c @@ -102,28 +102,19 @@ dump_oattr(struct fastbuf *out, struct oattr *oa) static void dump_parsed_bucket(struct fastbuf *out, struct obuck_header *h, struct fastbuf *b) { - mp_flush(pool); - struct odes *o = obj_read_bucket(buck_buf, h->type, h->length, b, NULL); + struct odes *o = obj_read_bucket(buck_buf, pool, h->type, h->length, b, NULL); if (!o) bprintf(out, "Cannot parse bucket %x of type %x and length %d: %m\n", h->oid, h->type, h->length); else { - if (h->type < BUCKET_TYPE_V30) - { - for (struct oattr *oa = o->attrs; oa; oa = oa->next) - dump_oattr(out, oa); - } - else - { #define IS_HEADER(x) (x=='O' || x=='U') - for (struct oattr *oa = o->attrs; oa; oa = oa->next) - if (IS_HEADER(oa->attr)) - dump_oattr(out, oa); - bputc(out, '\n'); - for (struct oattr *oa = o->attrs; oa; oa = oa->next) - if (!IS_HEADER(oa->attr)) - dump_oattr(out, oa); - } + for (struct oattr *oa = o->attrs; oa; oa = oa->next) + if (IS_HEADER(oa->attr)) + dump_oattr(out, oa); + bputc(out, '\n'); + for (struct oattr *oa = o->attrs; oa; oa = oa->next) + if (!IS_HEADER(oa->attr)) + dump_oattr(out, oa); } } @@ -417,7 +408,7 @@ main(int argc, char **argv) if (!raw) { pool = mp_new(1<<14); - buck_buf = buck2obj_alloc(pool); + buck_buf = buck2obj_alloc(); } switch (op) {