projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
drop str_[n]cat.
[apps/madmutt.git]
/
recvattach.c
diff --git
a/recvattach.c
b/recvattach.c
index
a592e15
..
885c528
100644
(file)
--- a/
recvattach.c
+++ b/
recvattach.c
@@
-13,9
+13,12
@@
#endif
#include <lib-lib/mem.h>
#endif
#include <lib-lib/mem.h>
+#include <lib-lib/str.h>
+#include <lib-lib/macros.h>
+#include <lib-lib/ascii.h>
+#include <lib-lib/file.h>
#include "mutt.h"
#include "mutt.h"
-#include "ascii.h"
#include "enter.h"
#include "handler.h"
#include "recvattach.h"
#include "enter.h"
#include "handler.h"
#include "recvattach.h"
@@
-29,9
+32,6
@@
#include "copy.h"
#include "mutt_crypt.h"
#include "copy.h"
#include "mutt_crypt.h"
-#include "lib/mem.h"
-#include "lib/intl.h"
-#include "lib/str.h"
#include <ctype.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdlib.h>
@@
-103,11
+103,11
@@
void mutt_update_tree (ATTACHPTR ** idx, short idxlen)
}
if (idx[x]->tree) {
}
if (idx[x]->tree) {
- if (
str_cmp
(idx[x]->tree, buf) != 0)
+ if (
m_strcmp
(idx[x]->tree, buf) != 0)
str_replace (&idx[x]->tree, buf);
}
else
str_replace (&idx[x]->tree, buf);
}
else
- idx[x]->tree =
str_dup
(buf);
+ idx[x]->tree =
m_strdup
(buf);
if (2 * (idx[x]->level + 2) < sizeof (buf) && idx[x]->level) {
s = buf + 2 * (idx[x]->level - 1);
if (2 * (idx[x]->level + 2) < sizeof (buf) && idx[x]->level) {
s = buf + 2 * (idx[x]->level - 1);
@@
-128,7
+128,7
@@
ATTACHPTR **mutt_gen_attach_list (BODY * m,
for (; m; m = m->next) {
if (*idxlen == *idxmax) {
for (; m; m = m->next) {
if (*idxlen == *idxmax) {
-
mem_realloc (&idx, sizeof (ATTACHPTR *) * ((*idxmax) += 5)
);
+
p_realloc(&idx, (*idxmax) += 5
);
for (i = *idxlen; i < *idxmax; i++)
idx[i] = NULL;
}
for (i = *idxlen; i < *idxmax; i++)
idx[i] = NULL;
}
@@
-146,7
+146,7
@@
ATTACHPTR **mutt_gen_attach_list (BODY * m,
}
else {
if (!idx[*idxlen])
}
else {
if (!idx[*idxlen])
- idx[*idxlen] =
(ATTACHPTR *) mem_calloc (1, sizeof (ATTACHPTR)
);
+ idx[*idxlen] =
p_new(ATTACHPTR, 1
);
new = idx[(*idxlen)++];
new->content = m;
new = idx[(*idxlen)++];
new->content = m;
@@
-409,8
+409,8
@@
static int mutt_query_save_attachment (FILE * fp, BODY * body, HEADER * hdr,
if (body->filename) {
if (directory && *directory)
if (body->filename) {
if (directory && *directory)
- mutt_concat_path
(buf, *directory, mutt_basename (body->filename)
,
-
sizeof (buf
));
+ mutt_concat_path
(buf, sizeof(buf), *directory
,
+
mutt_basename(body->filename
));
else
strfcpy (buf, body->filename, sizeof (buf));
}
else
strfcpy (buf, body->filename, sizeof (buf));
}
@@
-648,7
+648,7
@@
void mutt_pipe_attachment_list (FILE * fp, int tag, BODY * top, int filter)
filter = 0; /* sanity check: we can't filter in the recv case yet */
buf[0] = 0;
filter = 0; /* sanity check: we can't filter in the recv case yet */
buf[0] = 0;
-
memset (&state, 0, sizeof (STATE)
);
+
p_clear(&state, 1
);
if (mutt_get_field ((filter ? _("Filter through: ") : _("Pipe to: ")),
buf, sizeof (buf), M_CMD) != 0 || !buf[0])
if (mutt_get_field ((filter ? _("Filter through: ") : _("Pipe to: ")),
buf, sizeof (buf), M_CMD) != 0 || !buf[0])
@@
-752,7
+752,7
@@
void mutt_print_attachment_list (FILE * fp, int tag, BODY * top)
if (!can_print (top, tag))
return;
mutt_endwin (NULL);
if (!can_print (top, tag))
return;
mutt_endwin (NULL);
-
memset (&state, 0, sizeof (STATE)
);
+
p_clear(&state, 1
);
thepid = mutt_create_filter (NONULL (PrintCmd), &state.fpout, NULL, NULL);
print_attachment_list (fp, tag, top, &state);
fclose (state.fpout);
thepid = mutt_create_filter (NONULL (PrintCmd), &state.fpout, NULL, NULL);
print_attachment_list (fp, tag, top, &state);
fclose (state.fpout);
@@
-995,7
+995,7
@@
void mutt_view_attachments (HEADER * hdr)
attach_collapse (cur, 0, 1, 0);
mutt_update_attach_index (cur, &idx, &idxlen, &idxmax, menu);
attach_collapse (cur, 0, 1, 0);
mutt_update_attach_index (cur, &idx, &idxlen, &idxmax, menu);
-
FOREVER
{
+
for (;;)
{
if (op == OP_NULL)
op = mutt_menuLoop (menu);
switch (op) {
if (op == OP_NULL)
op = mutt_menuLoop (menu);
switch (op) {