no one should be reporting NOTOK for failure to display parts that
weren't actually requested. failure should be reserved for parts that
we really attempted to display.
(this fix is an extension of
c9794733.)
int alternating, nowalternate, result;
struct multipart *m = (struct multipart *) ct->c_ctparams;
struct part *part;
int alternating, nowalternate, result;
struct multipart *m = (struct multipart *) ct->c_ctparams;
struct part *part;
-/*
- * alternate -> we are a part inside an multipart/alternative
- * alternating -> we are a multipart/alternative
- */
+ /*
+ * alternate -> we are a part inside an multipart/alternative
+ * alternating -> we are a multipart/alternative
+ */
result = alternate ? NOTOK : OK;
result = alternate ? NOTOK : OK;
for (part = m->mp_parts; part; part = part->mp_next) {
p = part->mp_part;
for (part = m->mp_parts; part; part = part->mp_next) {
p = part->mp_part;
if (part_ok (p, 1) && type_ok (p, 1)) {
int inneresult;
if (part_ok (p, 1) && type_ok (p, 1)) {
int inneresult;
inneresult = show_switch (p, nowalternate, concatsw, textonly,
inlineonly, fmt);
inneresult = show_switch (p, nowalternate, concatsw, textonly,
inlineonly, fmt);
- if (alternating && !part && any_part_ok) {
+ if (alternating && !part && request_matched) {
if (!alternate)
content_error (NULL, ct, "don't know how to display any of the contents");
result = NOTOK;
if (!alternate)
content_error (NULL, ct, "don't know how to display any of the contents");
result = NOTOK;
+ /* if no parts matched what was requested, there can't have been
+ * any display errors, so we report OK. */
+ return request_matched ? result : OK;