From: Paul Fox Date: Sat, 26 Apr 2014 14:45:47 +0000 (-0400) Subject: mhshow: suppress error for undisplayable parts, if they're not wanted X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/c97947332ca87805ea0bc8ce81027c1aa23fdf0e mhshow: suppress error for undisplayable parts, if they're not wanted consider this message: 1 multipart/mixed 1113K 1 multipart/alternative 292 1.1 text/html 66 1.2 text/plain 49 2 image/jpeg 823K if this is displayed using "mshow -part 2", in the presence of an MHSHOW variable which _only_ describes a rule for displaying images, then we don't want to get an error about how nothing in part 1 was displayable. --- diff --git a/uip/mhshowsbr.c b/uip/mhshowsbr.c index 45c73cbe..f402b9c9 100644 --- a/uip/mhshowsbr.c +++ b/uip/mhshowsbr.c @@ -571,6 +571,7 @@ show_multi_internal (CT ct, int alternate, int concatsw, int textonly, int alternating, nowalternate, result; struct multipart *m = (struct multipart *) ct->c_ctparams; struct part *part; + int any_part_ok; CT p; alternating = 0; @@ -587,6 +588,7 @@ show_multi_internal (CT ct, int alternate, int concatsw, int textonly, */ result = alternate ? NOTOK : OK; + any_part_ok = 0; for (part = m->mp_parts; part; part = part->mp_next) { p = part->mp_part; @@ -594,6 +596,8 @@ show_multi_internal (CT ct, int alternate, int concatsw, int textonly, if (part_ok (p, 1) && type_ok (p, 1)) { int inneresult; + any_part_ok = 1; + inneresult = show_switch (p, nowalternate, concatsw, textonly, inlineonly, fmt); switch (inneresult) { @@ -621,7 +625,7 @@ show_multi_internal (CT ct, int alternate, int concatsw, int textonly, } } - if (alternating && !part) { + if (alternating && !part && any_part_ok) { if (!alternate) content_error (NULL, ct, "don't know how to display any of the contents"); result = NOTOK;