#define CHECK_MODE(x) if (!(x)) \
{ \
mutt_flushinp (); \
- mutt_error ("Not available in this menu."); \
+ mutt_error _("Not available in this menu."); \
break; \
}
#define CHECK_ATTACH if(option(OPTATTACHMSG)) \
{\
mutt_flushinp (); \
- mutt_error ("Function not permitted in attach-message mode."); \
+ mutt_error _("Function not permitted in attach-message mode."); \
break; \
}
resolve_types ((char *) fmt, *lineInfo, n, *last,
QuoteList, q_level, force_redraw, flags & M_SHOWCOLOR);
+
+ /* avoid race condition for continuation lines when scrolling up */
+ for (m = n + 1; m < *last && (*lineInfo)[m].offset && (*lineInfo)[m].continuation; m++)
+ (*lineInfo)[m].type = (*lineInfo)[n].type;
}
/* this also prevents searching through the hidden lines */
}
/* At this point, (*lineInfo[n]).quote may still be undefined. We
- * don't wont to compute it every time M_TYPES is set, since this
+ * don't want to compute it every time M_TYPES is set, since this
* would slow down the "bottom" function unacceptably. A compromise
* solution is hence to call regexec() again, just to find out the
* length of the quote prefix.
b->parts = mutt_read_mime_header (fp, 0);
}
break;
+
+ default:
+ return;
+ }
+
+ /* try to recover from parsing error */
+ if (!b->parts)
+ {
+ b->type = TYPETEXT;
+ safe_free ((void **) &b->subtype);
+ b->subtype = safe_strdup ("plain");
}
}
if (msg->length < 0)
msg->length = 0;
- if (msg->type == TYPEMULTIPART)
- msg->parts = mutt_parse_multipart (fp, mutt_get_parameter ("boundary", msg->parameter), msg->offset + msg->length, mutt_strcasecmp ("digest", msg->subtype) == 0);
- else if (msg->type == TYPEMESSAGE)
- msg->parts = mutt_parse_messageRFC822 (fp, msg);
- else
- return (msg);
-
- /* try to recover from parsing error */
- if (!msg->parts)
- {
- msg->type = TYPETEXT;
- safe_free ((void **) &msg->subtype);
- msg->subtype = safe_strdup ("plain");
- }
-
+ mutt_parse_part(fp, msg);
return (msg);
}
if ((msg = mx_open_message (ctx, cur->msgno)))
{
- fseek (msg->fp, cur->content->offset, 0);
-
- if (cur->content->type == TYPEMULTIPART)
- {
- if (!cur->content->parts)
- cur->content->parts = mutt_parse_multipart (msg->fp, mutt_get_parameter ("boundary", cur->content->parameter), cur->content->offset + cur->content->length, mutt_strcasecmp ("digest", cur->content->subtype) == 0);
- }
- else
- {
- if (!cur->content->parts)
- cur->content->parts = mutt_parse_messageRFC822 (msg->fp, cur->content);
- }
-
- /* try to recover from parsing error */
- if (!cur->content->parts)
- {
- cur->content->type = TYPETEXT;
- safe_free ((void **) &cur->content->subtype);
- cur->content->subtype = safe_strdup ("plain");
- }
-
+ mutt_parse_part (msg->fp, cur->content);
#ifdef _PGPPATH
/* See if we need to recurse on this MIME part. */
- if (tattach->type == TYPEMULTIPART)
- {
- fseek (fpout, tattach->offset, 0);
- tattach->parts = mutt_parse_multipart (fpout, mutt_get_parameter ("boundary", tattach->parameter), tattach->offset + tattach->length, mutt_strcasecmp ("digest", tattach->subtype) == 0);
- }
- else if (tattach->type == TYPEMESSAGE)
- {
- fseek (fpout, tattach->offset, 0);
- tattach->parts = mutt_parse_messageRFC822 (fpout, tattach);
- }
+ mutt_parse_part (fpout, tattach);
}
return (tattach);
{
BODY *b;
- fseek (msg->fp, hdr->content->offset, 0);
-
- if (hdr->content->type == TYPEMULTIPART)
- {
- hdr->content->parts = mutt_parse_multipart (msg->fp,
- mutt_get_parameter ("boundary", hdr->content->parameter),
- hdr->content->offset + hdr->content->length,
- mutt_strcasecmp ("digest", hdr->content->subtype) == 0);
- }
- else
- hdr->content->parts = mutt_parse_messageRFC822 (msg->fp, hdr->content);
+ mutt_parse_part (msg->fp, hdr->content);
/* Now that we know what was in the other message, convert to the new
* message.