X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;ds=sidebyside;f=uip%2Fmhshowsbr.c;h=2a8bbf9269f2b56d5eeff212c2ec9856116ca0b2;hb=4c1efddfd499300c7e74263e57d8aa137e84c853;hp=3bcf84f937417c80fa20571eaec1d0b68f9df281;hpb=7ca05c3df912f540c1f25b3be4d1733f5a3ad1b4;p=mmh diff --git a/uip/mhshowsbr.c b/uip/mhshowsbr.c index 3bcf84f..2a8bbf9 100644 --- a/uip/mhshowsbr.c +++ b/uip/mhshowsbr.c @@ -85,9 +85,16 @@ show_all_messages(CT *cts) for (ctp = cts; *ctp; ctp++) { ct = *ctp; - /* if top-level type is ok, then display message */ - if (type_ok(ct, 1)) - show_single_message(ct, formsw); + if (!type_ok(ct, 1)) { /* top-level type */ + continue; + } + if (cts[1]) { + if (ctp != cts) { + printf("\n\n"); + } + printf(">>> Message %s\n\n", ct->c_file); + } + show_single_message(ct, formsw); } } @@ -226,13 +233,13 @@ show_content(CT ct, int alternate) CI ci = &ct->c_ctinfo; /* Check for mhshow-show-type/subtype */ - snprintf(buffer, sizeof(buffer), "%s-show-%s/%s", - invo_name, ci->ci_type, ci->ci_subtype); + snprintf(buffer, sizeof(buffer), "mhshow-show-%s/%s", + ci->ci_type, ci->ci_subtype); if ((cp = context_find(buffer)) && *cp != '\0') return show_content_aux(ct, alternate, cp, NULL); /* Check for mhshow-show-type */ - snprintf(buffer, sizeof(buffer), "%s-show-%s", invo_name, ci->ci_type); + snprintf(buffer, sizeof(buffer), "mhshow-show-%s", ci->ci_type); if ((cp = context_find(buffer)) && *cp != '\0') return show_content_aux(ct, alternate, cp, NULL); @@ -312,9 +319,8 @@ show_content_aux(CT ct, int alternate, char *cp, char *cracked) case 'c': /* insert charset */ - if (ct->c_charset) { - strncpy(bp, ct->c_charset, buflen); - } + strncpy(bp, ct->c_charset ? ct->c_charset : + "US-ASCII", buflen); break; case 'd': @@ -498,13 +504,13 @@ show_text(CT ct, int alternate) CI ci = &ct->c_ctinfo; /* Check for mhshow-show-type/subtype */ - snprintf(buffer, sizeof(buffer), "%s-show-%s/%s", - invo_name, ci->ci_type, ci->ci_subtype); + snprintf(buffer, sizeof(buffer), "mhshow-show-%s/%s", + ci->ci_type, ci->ci_subtype); if ((cp = context_find(buffer)) && *cp != '\0') return show_content_aux(ct, alternate, cp, NULL); /* Check for mhshow-show-type */ - snprintf(buffer, sizeof(buffer), "%s-show-%s", invo_name, ci->ci_type); + snprintf(buffer, sizeof(buffer), "mhshow-show-%s", ci->ci_type); if ((cp = context_find(buffer)) && *cp != '\0') return show_content_aux(ct, alternate, cp, NULL); @@ -513,7 +519,8 @@ show_text(CT ct, int alternate) ** if it is not a text part of a multipart/alternative */ if (!alternate || ct->c_subtype == TEXT_PLAIN) { - if (!check_charset(ct->c_charset, strlen(ct->c_charset))) { + if (ct->c_charset && !check_charset(ct->c_charset, + strlen(ct->c_charset))) { snprintf(buffer, sizeof(buffer), "%%liconv -f '%s'", ct->c_charset); } else { @@ -538,13 +545,13 @@ show_multi(CT ct, int alternate) CI ci = &ct->c_ctinfo; /* Check for mhshow-show-type/subtype */ - snprintf(buffer, sizeof(buffer), "%s-show-%s/%s", - invo_name, ci->ci_type, ci->ci_subtype); + snprintf(buffer, sizeof(buffer), "mhshow-show-%s/%s", + ci->ci_type, ci->ci_subtype); if ((cp = context_find(buffer)) && *cp != '\0') return show_multi_aux(ct, alternate, cp); /* Check for mhshow-show-type */ - snprintf(buffer, sizeof(buffer), "%s-show-%s", invo_name, ci->ci_type); + snprintf(buffer, sizeof(buffer), "mhshow-show-%s", ci->ci_type); if ((cp = context_find(buffer)) && *cp != '\0') return show_multi_aux(ct, alternate, cp); @@ -714,9 +721,8 @@ show_multi_aux(CT ct, int alternate, char *cp) case 'c': /* insert charset */ - if (ct->c_charset) { - strncpy(bp, ct->c_charset, buflen); - } + strncpy(bp, ct->c_charset ? ct->c_charset : + "US-ASCII", buflen); break; case 'd': @@ -844,13 +850,13 @@ show_message_rfc822(CT ct, int alternate) CI ci = &ct->c_ctinfo; /* Check for mhshow-show-type/subtype */ - snprintf(buffer, sizeof(buffer), "%s-show-%s/%s", - invo_name, ci->ci_type, ci->ci_subtype); + snprintf(buffer, sizeof(buffer), "mhshow-show-%s/%s", + ci->ci_type, ci->ci_subtype); if ((cp = context_find(buffer)) && *cp != '\0') return show_content_aux(ct, alternate, cp, NULL); /* Check for mhshow-show-type */ - snprintf(buffer, sizeof(buffer), "%s-show-%s", invo_name, ci->ci_type); + snprintf(buffer, sizeof(buffer), "mhshow-show-%s", ci->ci_type); if ((cp = context_find(buffer)) && *cp != '\0') return show_content_aux(ct, alternate, cp, NULL);