X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/5dd6771b28c257af405d7248639ed0e3bcdce38b..ebd71fa45bb0538e65e3106de57a04ae6c70abae:/uip/mhlistsbr.c diff --git a/uip/mhlistsbr.c b/uip/mhlistsbr.c index 1aac74a8..b39ed3d7 100644 --- a/uip/mhlistsbr.c +++ b/uip/mhlistsbr.c @@ -198,26 +198,32 @@ list_content (CT ct, int toplevel, int realsize, int verbose, int debug) if (ct->c_descr) { char *dp; - dp = trimcpy (cp = add (ct->c_descr, NULL)); - free (cp); + dp = cpytrim (ct->c_descr); printf (LSTFMT2d1, dp); free (dp); } printf ("\n"); - /* - * If verbose, print any RFC-822 comments in the - * Content-Type line. - */ - if (verbose && ci->ci_comment) { - char *dp; + if (verbose) { + char **ap, **ep; + CI ci = &ct->c_ctinfo; - dp = trimcpy (cp = add (ci->ci_comment, NULL)); - free (cp); - snprintf (buffer, sizeof(buffer), "(%s)", dp); - free (dp); - printf (LSTFMT2d2, buffer); + for (ap = ci->ci_attrs, ep = ci->ci_values; *ap; ap++, ep++) + printf ("\t %s=\"%s\"\n", *ap, *ep); + + /* + * If verbose, print any RFC-822 comments in the + * Content-Type line. + */ + if (ci->ci_comment) { + char *dp; + + dp = cpytrim (ci->ci_comment); + snprintf (buffer, sizeof(buffer), "(%s)", dp); + free (dp); + printf (LSTFMT2d2, buffer); + } } if (debug) @@ -274,7 +280,7 @@ list_debug (CT ct) /* print internal flags for transfer encoding */ fprintf (stderr, " transfer encoding 0x%x params 0x%x\n", - ct->c_encoding, (unsigned int)(unsigned long) ct->c_cefile); + ct->c_encoding, (unsigned int)(unsigned long) &ct->c_cefile); /* print Content-ID */ if (ct->c_id) @@ -394,19 +400,15 @@ list_external (CT ct, int toplevel, int realsize, int verbose, int debug) /* * list content information for type "application" + * This no longer needs to be a separate function. It used to + * produce some output with verbose enabled, but that has been + * moved to list_content (). */ static int list_application (CT ct, int toplevel, int realsize, int verbose, int debug) { list_content (ct, toplevel, realsize, verbose, debug); - if (verbose) { - char **ap, **ep; - CI ci = &ct->c_ctinfo; - - for (ap = ci->ci_attrs, ep = ci->ci_values; *ap; ap++, ep++) - printf ("\t %s=\"%s\"\n", *ap, *ep); - } return OK; } @@ -420,12 +422,11 @@ list_application (CT ct, int toplevel, int realsize, int verbose, int debug) static int list_encoding (CT ct) { - CE ce; + CE ce = &ct->c_cefile; - if ((ce = ct->c_cefile)) - fprintf (stderr, " decoded fp 0x%x file \"%s\"\n", - (unsigned int)(unsigned long) ce->ce_fp, - ce->ce_file ? ce->ce_file : ""); + fprintf (stderr, " decoded fp 0x%x file \"%s\"\n", + (unsigned int)(unsigned long) ce->ce_fp, + ce->ce_file ? ce->ce_file : ""); return OK; }