X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/d4d773c1fe95ed03f9aa5a0baa2c387c2943aa3a..ef1ba39e8dae81091b6c3e73e72825ef6edea3c6:/uip/mhlistsbr.c?ds=inline diff --git a/uip/mhlistsbr.c b/uip/mhlistsbr.c index d2d394fa..f5459cd4 100644 --- a/uip/mhlistsbr.c +++ b/uip/mhlistsbr.c @@ -10,7 +10,6 @@ #include #include -#include #include #include #include @@ -18,7 +17,7 @@ #include /* mhmisc.c */ -int part_ok (CT, int); +int part_ok (CT); int type_ok (CT, int); void flush_errors (void); @@ -40,12 +39,14 @@ static int list_encoding (CT); #define LSTFMT1 "%4s %-5s %-24s %5s %s\n" #define LSTFMT2a "%4d " #define LSTFMT2b "%-5s %-24.24s " +#define LSTFMT2bv "%-5s %-24s " #define LSTFMT2c1 "%5lu" #define LSTFMT2c2 "%4lu%c" #define LSTFMT2c3 "huge " #define LSTFMT2c4 " " #define LSTFMT2d1 " %.36s" -#define LSTFMT2d2 "\t %-65.65s\n" +#define LSTFMT2d1v " %s" +#define LSTFMT2d2 "\t %-65s\n" /* @@ -125,12 +126,9 @@ list_switch (CT ct, int toplevel, int realsize, int verbose, int debug, return list_content (ct, toplevel, realsize, verbose, debug, dispo); case CT_APPLICATION: + default: return list_application (ct, toplevel, realsize, verbose, debug, dispo); - - default: - /* list_debug (ct); */ - adios (NULL, "unknown content type %d", ct->c_type); } return 0; /* NOT REACHED */ @@ -159,7 +157,10 @@ list_content (CT ct, int toplevel, int realsize, int verbose, int debug, snprintf (buffer, sizeof(buffer), "%s/%s", empty (ci->ci_type), empty (ci->ci_subtype)); - printf (LSTFMT2b, empty (ct->c_partno), buffer); + if (verbose) + printf (LSTFMT2bv, empty (ct->c_partno), buffer); + else + printf (LSTFMT2b, empty (ct->c_partno), buffer); if (ct->c_cesizefnx && realsize) size = (*ct->c_cesizefnx) (ct); @@ -167,7 +168,7 @@ list_content (CT ct, int toplevel, int realsize, int verbose, int debug, size = ct->c_end - ct->c_begin; /* find correct scale for size (Kilo/Mega/Giga/Tera) */ - for (cp = " KMGT"; size > 9999; size >>= 10) + for (cp = " KMGT"; size > 9999; size /= 1000) if (!*++cp) break; @@ -193,11 +194,14 @@ list_content (CT ct, int toplevel, int realsize, int verbose, int debug, char *dp; dp = cpytrim (ct->c_descr); - printf (LSTFMT2d1, dp); + if (verbose) + printf (LSTFMT2d1v, dp); + else + printf (LSTFMT2d1, dp); free (dp); } - printf ("\n"); + putchar('\n'); if (verbose) { CI ci = &ct->c_ctinfo; @@ -338,7 +342,7 @@ list_multi (CT ct, int toplevel, int realsize, int verbose, int debug, for (part = m->mp_parts; part; part = part->mp_next) { CT p = part->mp_part; - if (part_ok (p, 1) && type_ok (p, 1)) + if (part_ok (p) && type_ok (p, 1)) list_switch (p, 0, realsize, verbose, debug, dispo); }