# include "config.h"
#endif
+#include <lib-lib/mem.h>
+
#include "mutt.h"
#include "ascii.h"
#include "enter.h"
break; \
}
+#define SW (option(OPTMBOXPANE)?SidebarWidth:0)
+
static struct mapping_t AttachHelp[] = {
{N_("Exit"), OP_EXIT},
{N_("Save"), OP_SAVE},
{N_("Pipe"), OP_PIPE},
{N_("Print"), OP_PRINT},
{N_("Help"), OP_HELP},
- {NULL}
+ {NULL, OP_NULL}
};
static int mutt_extract_path (char *filename, char *path)
{
- char *tmp = mem_malloc (sizeof (char) * _POSIX_PATH_MAX);
+ char *tmp = p_new(char, _POSIX_PATH_MAX);
char *help_ptr;
help_ptr = tmp;
}
*help_ptr++ = *filename++;
}
- mem_free (&tmp);
+ p_delete(&tmp);
return 0;
}
snprintf (dest, destlen, fmt, aptr->num + 1);
}
break;
+ case 'Q':
+ if (optional)
+ optional = aptr->content->attach_qualifies;
+ else {
+ snprintf (fmt, sizeof (fmt), "%%%sc", prefix);
+ mutt_format_s (dest, destlen, fmt, "Q");
+ }
+ break;
case 's':
if (flags & M_FORMAT_STAT_FILE) {
struct stat st;
else if (!aptr->content->unlink)
optional = 0;
break;
+ case 'X':
+ if (optional)
+ optional = (aptr->content->attach_count + aptr->content->attach_qualifies) != 0;
+ else {
+ snprintf (fmt, sizeof (fmt), "%%%sd", prefix);
+ snprintf (dest, destlen, fmt, aptr->content->attach_count + aptr->content->attach_qualifies);
+ }
+ break;
default:
*dest = 0;
}
static void attach_entry (char *b, size_t blen, MUTTMENU * menu, int num)
{
- mutt_FormatString (b, blen, NONULL (AttachFormat), mutt_attach_fmt,
+ int w=(COLS-SW)>blen?blen:(COLS-SW);
+ mutt_FormatString (b, w, NONULL (AttachFormat), mutt_attach_fmt,
(unsigned long) (((ATTACHPTR **) menu->data)[num]),
M_FORMAT_ARROWCURSOR);
}
break;
}
- mem_free (&directory);
+ p_delete(&directory);
if (tag && menu) {
menu->oldcurrent = menu->current;
hdr->attach_del = 1;
if (idx[idxmax]->content)
idx[idxmax]->content->aptr = NULL;
- mem_free (&idx[idxmax]->tree);
- mem_free (&idx[idxmax]);
+ p_delete(&idx[idxmax]->tree);
+ p_delete(&idx[idxmax]);
}
if (hdr->attach_del)
hdr->changed = 1;
- mem_free (&idx);
+ p_delete(&idx);
idxmax = 0;
if (WithCrypto && need_secured && secured) {