#endif
#include <lib-lib/mem.h>
+#include <lib-lib/ascii.h>
+#include <lib-lib/str.h>
#include <lib-lib/macros.h>
#include "mutt.h"
-#include "ascii.h"
#include "handler.h"
#include "recvattach.h"
#include "mutt_menu.h"
#include "mx.h"
#include "mutt_crypt.h"
-#include "lib/str.h"
#include "lib/debug.h"
#include <ctype.h>
}
}
else {
- lng = str_len (p);
+ lng = m_strlen(p);
if (buf[lng] == '/' && str_ncasecmp (buf, p, lng) == 0)
return (1);
}
int i;
for (; t; t = t->next) {
- i = str_len (t->data) - 1;
+ i = m_strlen(t->data) - 1;
if ((i > 0 && t->data[i - 1] == '/' && t->data[i] == '*' &&
ascii_strncasecmp (type, t->data, i) == 0) ||
ascii_strcasecmp (type, t->data) == 0) {
}
for (; t; t = t->next) {
- i = str_len (t->data) - 1;
+ i = m_strlen(t->data) - 1;
if ((i > 0 && t->data[i - 1] == '/' && t->data[i] == '*' &&
ascii_strncasecmp (type, t->data, i) == 0) ||
ascii_strcasecmp (type, t->data) == 0)
strfcpy (command, entry->command, sizeof (command));
if (fp) {
- fname = str_dup (a->filename);
+ fname = m_strdup(a->filename);
mutt_sanitize_filename (fname, 1);
}
else
if (use_pager) {
pager_t info;
+ p_clear(&info, 1);
- memset (&info, 0, sizeof (info));
- info.fp = fp;
+ info.fp = fp;
info.bdy = a;
info.ctx = Context;
info.idx = idx;
info.idxlen = idxlen;
info.hdr = hdr;
- rc = mutt_do_pager (descrip, pagerfile,
- M_PAGER_ATTACHMENT | (is_message ? M_PAGER_MESSAGE :
- 0), &info);
+ rc = mutt_do_pager(descrip, pagerfile,
+ M_PAGER_ATTACHMENT | (is_message ? M_PAGER_MESSAGE : 0),
+ &info);
*pagerfile = '\0';
}
else
if (fp) {
/* recv case */
-
STATE s;
-
- memset (&s, 0, sizeof (STATE));
+ p_clear(&s, 1);
if (outfile && *outfile)
- thepid =
- mutt_create_filter_fd (path, &s.fpout, NULL, NULL, -1, out, -1);
+ thepid = mutt_create_filter_fd(path, &s.fpout, NULL, NULL, -1, out, -1);
else
- thepid = mutt_create_filter (path, &s.fpout, NULL, NULL);
+ thepid = mutt_create_filter(path, &s.fpout, NULL, NULL);
if (thepid < 0) {
mutt_perror (_("Can't create filter"));
/* In recv mode, extract from folder and decode */
STATE s;
+ p_clear(&s, 1);
- memset (&s, 0, sizeof (s));
if ((s.fpout = mutt_save_attachment_open (path, flags)) == NULL) {
mutt_perror ("fopen");
return (-1);
BODY *saved_parts = NULL;
HEADER *saved_hdr = NULL;
- memset (&s, 0, sizeof (s));
+ p_clear(&s, 1);
s.flags = displaying;
if (flags == M_SAVE_APPEND)