From: markus schnalke Date: Tue, 27 Mar 2012 12:48:42 +0000 (+0200) Subject: Fixed mhlist -verbose to work with all content types [Bug #35219]. X-Git-Tag: mmh-thesis-end~135 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=6bd5e1baa07e971d42188391a12f330b82174c48;p=mmh Fixed mhlist -verbose to work with all content types [Bug #35219]. Pulled in from nmh. Thanks to David Levine. --- diff --git a/uip/mhlistsbr.c b/uip/mhlistsbr.c index 4c788d1..9cd331a 100644 --- a/uip/mhlistsbr.c +++ b/uip/mhlistsbr.c @@ -37,7 +37,6 @@ static int list_debug(CT); static int list_multi(CT, int, int, int, int); static int list_partial(CT, int, int, int, int); static int list_external(CT, int, int, int, int); -static int list_application(CT, int, int, int, int); static int list_encoding(CT); @@ -58,7 +57,6 @@ static int list_encoding(CT); /* ** Top level entry point to list group of messages */ - void list_all_messages(CT *cts, int headers, int realsize, int verbose, int debug) { @@ -80,7 +78,6 @@ list_all_messages(CT *cts, int headers, int realsize, int verbose, int debug) /* ** Entry point to list a single message */ - static void list_single_message(CT ct, int realsize, int verbose, int debug) { @@ -100,7 +97,6 @@ list_single_message(CT ct, int realsize, int verbose, int debug) /* ** Primary switching routine to list information about a content */ - int list_switch(CT ct, int toplevel, int realsize, int verbose, int debug) { @@ -133,12 +129,8 @@ list_switch(CT ct, int toplevel, int realsize, int verbose, int debug) case CT_AUDIO: case CT_IMAGE: case CT_VIDEO: - return list_content(ct, toplevel, realsize, verbose, debug); - break; - case CT_APPLICATION: - return list_application(ct, toplevel, realsize, verbose, - debug); + return list_content(ct, toplevel, realsize, verbose, debug); break; default: @@ -156,7 +148,6 @@ list_switch(CT ct, int toplevel, int realsize, int verbose, int debug) /* ** Method for listing information about a simple/generic content */ - int list_content(CT ct, int toplevel, int realsize, int verbose, int debug) { @@ -209,18 +200,27 @@ list_content(CT ct, int toplevel, int realsize, int verbose, int debug) 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 = getcpy(ci->ci_comment)); - 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 = trimcpy(cp = add(ci->ci_comment, NULL)); + free (cp); + snprintf(buffer, sizeof(buffer), "(%s)", dp); + free(dp); + printf(LSTFMT2d2, buffer); + } } if (debug) @@ -233,7 +233,6 @@ list_content(CT ct, int toplevel, int realsize, int verbose, int debug) /* ** Print debugging information about a content */ - static int list_debug(CT ct) { @@ -304,7 +303,6 @@ list_debug(CT ct) /* ** list content information for type "multipart" */ - static int list_multi(CT ct, int toplevel, int realsize, int verbose, int debug) { @@ -329,7 +327,6 @@ list_multi(CT ct, int toplevel, int realsize, int verbose, int debug) /* ** list content information for type "message/partial" */ - static int list_partial(CT ct, int toplevel, int realsize, int verbose, int debug) { @@ -351,7 +348,6 @@ list_partial(CT ct, int toplevel, int realsize, int verbose, int debug) /* ** list content information for type "message/external" */ - static int list_external(CT ct, int toplevel, int realsize, int verbose, int debug) { @@ -398,30 +394,9 @@ list_external(CT ct, int toplevel, int realsize, int verbose, int debug) /* -** list content information for type "application" -*/ - -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; -} - - -/* ** list information about the Content-Transfer-Encoding ** used by a content. */ - static int list_encoding(CT ct) {