}
else
{
- struct AttachPtr *new = mutt_mem_calloc(1, sizeof(struct AttachPtr));
- mutt_actx_add_attach(actx, new);
- new->content = m;
- m->aptr = new;
- new->parent_type = parent_type;
- new->level = level;
+ struct AttachPtr *ap = mutt_mem_calloc(1, sizeof(struct AttachPtr));
+ mutt_actx_add_attach(actx, ap);
+ ap->content = m;
+ m->aptr = ap;
+ ap->parent_type = parent_type;
+ ap->level = level;
/* We don't support multipart messages in the compose menu yet */
}
* update_idx - Add a new attchment to the message
* @param menu Current menu
* @param actx Attachment context
- * @param new Attachment to add
+ * @param ap Attachment to add
*/
-static void update_idx(struct Menu *menu, struct AttachCtx *actx, struct AttachPtr *new)
+static void update_idx(struct Menu *menu, struct AttachCtx *actx, struct AttachPtr *ap)
{
- new->level = (actx->idxlen > 0) ? actx->idx[actx->idxlen - 1]->level : 0;
+ ap->level = (actx->idxlen > 0) ? actx->idx[actx->idxlen - 1]->level : 0;
if (actx->idxlen)
- actx->idx[actx->idxlen - 1]->content->next = new->content;
- new->content->aptr = new;
- mutt_actx_add_attach(actx, new);
+ actx->idx[actx->idxlen - 1]->content->next = ap->content;
+ ap->content->aptr = ap;
+ mutt_actx_add_attach(actx, ap);
mutt_update_compose_menu(actx, menu, false);
menu->current = actx->vcount - 1;
}
{
if (!(WithCrypto & APPLICATION_PGP))
break;
- struct AttachPtr *new = mutt_mem_calloc(1, sizeof(struct AttachPtr));
- new->content = crypt_pgp_make_key_attachment();
- if (new->content)
+ struct AttachPtr *ap = mutt_mem_calloc(1, sizeof(struct AttachPtr));
+ ap->content = crypt_pgp_make_key_attachment();
+ if (ap->content)
{
- update_idx(menu, actx, new);
+ update_idx(menu, actx, ap);
menu->redraw |= REDRAW_INDEX;
}
else
- FREE(&new);
+ FREE(&ap);
menu->redraw |= REDRAW_STATUS;
for (int i = 0; i < numfiles; i++)
{
char *att = files[i];
- struct AttachPtr *new = mutt_mem_calloc(1, sizeof(struct AttachPtr));
- new->unowned = true;
- new->content = mutt_make_file_attach(att);
- if (new->content)
- update_idx(menu, actx, new);
+ struct AttachPtr *ap = mutt_mem_calloc(1, sizeof(struct AttachPtr));
+ ap->unowned = true;
+ ap->content = mutt_make_file_attach(att);
+ if (ap->content)
+ update_idx(menu, actx, ap);
else
{
error = true;
mutt_error(_("Unable to attach %s"), att);
- FREE(&new);
+ FREE(&ap);
}
FREE(&files[i]);
}
if (!message_is_tagged(Context, i))
continue;
- struct AttachPtr *new = mutt_mem_calloc(1, sizeof(struct AttachPtr));
- new->content = mutt_make_message_attach(Context->mailbox,
- Context->mailbox->emails[i], true);
- if (new->content)
- update_idx(menu, actx, new);
+ struct AttachPtr *ap = mutt_mem_calloc(1, sizeof(struct AttachPtr));
+ ap->content = mutt_make_message_attach(Context->mailbox,
+ Context->mailbox->emails[i], true);
+ if (ap->content)
+ update_idx(menu, actx, ap);
else
{
mutt_error(_("Unable to attach"));
- FREE(&new);
+ FREE(&ap);
}
}
menu->redraw |= REDRAW_FULL;
mutt_error(_("Unknown Content-Type %s"), type);
continue;
}
- struct AttachPtr *new = mutt_mem_calloc(1, sizeof(struct AttachPtr));
+ struct AttachPtr *ap = mutt_mem_calloc(1, sizeof(struct AttachPtr));
/* Touch the file */
FILE *fp = mutt_file_fopen(buf, "w");
if (!fp)
{
mutt_error(_("Can't create file %s"), buf);
- FREE(&new);
+ FREE(&ap);
continue;
}
mutt_file_fclose(&fp);
- new->content = mutt_make_file_attach(buf);
- if (!new->content)
+ ap->content = mutt_make_file_attach(buf);
+ if (!ap->content)
{
mutt_error(_("What we have here is a failure to make an attachment"));
- FREE(&new);
+ FREE(&ap);
continue;
}
- update_idx(menu, actx, new);
+ update_idx(menu, actx, ap);
CUR_ATTACH->content->type = itype;
mutt_str_replace(&CUR_ATTACH->content->subtype, p);
struct Body *parts, FILE *fp,
int parent_type, int level, bool decrypted)
{
- struct AttachPtr *new = NULL;
struct Body *m = NULL;
struct Body *new_body = NULL;
FILE *fp_new = NULL;
}
else
{
- new = mutt_mem_calloc(1, sizeof(struct AttachPtr));
- mutt_actx_add_attach(actx, new);
-
- new->content = m;
- new->fp = fp;
- m->aptr = new;
- new->parent_type = parent_type;
- new->level = level;
- new->decrypted = decrypted;
+ struct AttachPtr *ap = mutt_mem_calloc(1, sizeof(struct AttachPtr));
+ mutt_actx_add_attach(actx, ap);
+
+ ap->content = m;
+ ap->fp = fp;
+ m->aptr = ap;
+ ap->parent_type = parent_type;
+ ap->level = level;
+ ap->decrypted = decrypted;
if (m->type == TYPE_MULTIPART)
mutt_generate_recvattach_list(actx, e, m->parts, fp, m->type, level + 1, decrypted);