X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=recvcmd.c;h=71fc95b8988ed27215ea8ca76cd0f246c4f6c702;hp=a8e4b6b27dcc44461ebd2507c2283b7a8edfb33a;hb=6eb22b54ec44fd63bea311f472c9aadc7176c230;hpb=7b392ef7b50798f9eb3e7c869e634c5fef0092d1 diff --git a/recvcmd.c b/recvcmd.c index a8e4b6b..71fc95b 100644 --- a/recvcmd.c +++ b/recvcmd.c @@ -32,7 +32,7 @@ static short check_msg (BODY * b, short err) { - if (!mutt_is_message_type (b->type, b->subtype)) { + if (!mutt_is_message_type(b)) { if (err) mutt_error _("You may only bounce message/rfc822 parts."); @@ -153,7 +153,7 @@ void mutt_attach_bounce (FILE * fp, HEADER * hdr __attribute__ ((unused)), } buf[0] = 0; - rfc822_write_address (buf, sizeof (buf), adr, 1); + rfc822_addrcat(buf, sizeof(buf), adr, 1); #define extra_space (15+7+2) /* @@ -163,7 +163,7 @@ void mutt_attach_bounce (FILE * fp, HEADER * hdr __attribute__ ((unused)), (p ? _("Bounce message to %s") : _("Bounce messages to %s")), buf); - if (mutt_strwidth (prompt) > COLS - extra_space) { + if (m_strwidth(prompt) > COLS - extra_space) { mutt_format_string (prompt, sizeof (prompt) - 4, 0, COLS - extra_space, 0, 0, prompt, sizeof (prompt), 0); @@ -239,8 +239,7 @@ static HEADER *find_common_parent (ATTACHPTR ** idx, short idxlen, break; while (--i >= 0) { - if (mutt_is_message_type - (idx[i]->content->type, idx[i]->content->subtype)) { + if (mutt_is_message_type(idx[i]->content)) { nchildren = count_tagged_children (idx, idxlen, i); if (nchildren == nattach) return idx[i]->content->hdr; @@ -278,8 +277,7 @@ static HEADER *find_parent (ATTACHPTR ** idx, short idxlen, BODY * cur, if (cur) { for (i = 0; i < idxlen; i++) { - if (mutt_is_message_type - (idx[i]->content->type, idx[i]->content->subtype) + if (mutt_is_message_type(idx[i]->content) && is_parent (i, idx, idxlen, cur)) parent = idx[i]->content->hdr; if (idx[i]->content == cur) @@ -296,7 +294,7 @@ static void include_header (int quote, FILE * ifp, HEADER * hdr, FILE * ofp, char *_prefix) { int chflags = CH_DECODE; - char prefix[SHORT_STRING]; + char prefix[STRING]; if (option (OPTWEED)) chflags |= CH_WEED | CH_REORDER; @@ -329,8 +327,7 @@ static int mutt_copy_body (FILE * fp, BODY ** tgt, BODY * src) if (src->filename) { use_disp = 1; m_strcpy(tmp, sizeof(tmp), src->filename); - } - else { + } else { use_disp = 0; tmp[0] = '\0'; } @@ -443,7 +440,7 @@ static void attach_forward_bodies (FILE * fp, HEADER * hdr, tmphdr->env = envelope_new(); mutt_make_forward_subject (tmphdr->env, Context, parent); - tmpfp = m_tempfile(tmpbody, sizeof(tmpbody), NONULL(Tempdir), NULL); + tmpfp = m_tempfile(tmpbody, sizeof(tmpbody), NONULL(MCore.tmpdir), NULL); if (!tmpfp) { mutt_error(_("Could not create temporary file")); return; @@ -543,21 +540,15 @@ static void attach_forward_bodies (FILE * fp, HEADER * hdr, } mutt_forward_trailer (tmpfp); - - fclose (tmpfp); - tmpfp = NULL; + m_fclose(&tmpfp); /* now that we have the template, send it. */ ci_send_message (flags, tmphdr, tmpbody, NULL, parent); return; bail: - - if (tmpfp) { - fclose (tmpfp); - mutt_unlink (tmpbody); - } - + m_fclose(&tmpfp); + mutt_unlink(tmpbody); header_delete(&tmphdr); } @@ -611,7 +602,7 @@ static void attach_forward_msgs (FILE * fp, HEADER * hdr __attribute__ ((unused) /* no MIME encapsulation */ - tmpfp = m_tempfile(tmpbody, sizeof(tmpbody), NONULL(Tempdir), NULL); + tmpfp = m_tempfile(tmpbody, sizeof(tmpbody), NONULL(MCore.tmpdir), NULL); if (!tmpfp) { mutt_error(_("Could not create temporary file")); header_delete(&tmphdr); @@ -651,7 +642,7 @@ static void attach_forward_msgs (FILE * fp, HEADER * hdr __attribute__ ((unused) } } } - fclose (tmpfp); + m_fclose(&tmpfp); } else if (rc == M_YES) { /* do MIME encapsulation - we don't need to do much here */ last = &tmphdr->content; @@ -803,7 +794,6 @@ static void attach_include_reply (FILE * fp, FILE * tmpfp, HEADER * cur, } _mutt_copy_message (tmpfp, fp, cur, cur->content, cmflags, chflags); - mutt_make_post_indent (Context, cur, tmpfp); } void mutt_attach_reply (FILE * fp, HEADER * hdr, @@ -820,7 +810,7 @@ void mutt_attach_reply (FILE * fp, HEADER * hdr, char tmpbody[_POSIX_PATH_MAX]; FILE *tmpfp; - char prefix[SHORT_STRING]; + char prefix[STRING]; int rc; #ifdef USE_NNTP @@ -859,7 +849,7 @@ void mutt_attach_reply (FILE * fp, HEADER * hdr, return; } - tmpfp = m_tempfile(tmpbody, sizeof(tmpbody), NONULL(Tempdir), NULL); + tmpfp = m_tempfile(tmpbody, sizeof(tmpbody), NONULL(MCore.tmpdir), NULL); if (!tmpfp) { mutt_error(_("Could not create temporary file")); header_delete(&tmphdr); @@ -915,18 +905,16 @@ void mutt_attach_reply (FILE * fp, HEADER * hdr, } } - mutt_make_post_indent (Context, parent, tmpfp); - if (mime_reply_any && !cur && copy_problematic_attachments (fp, &tmphdr->content, idx, idxlen, 0) == NULL) { header_delete(&tmphdr); - fclose (tmpfp); + m_fclose(&tmpfp); return; } } - fclose (tmpfp); + m_fclose(&tmpfp); if (ci_send_message (flags, tmphdr, tmpbody, NULL, parent) == 0) mutt_set_flag (Context, hdr, M_REPLIED, 1);