projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
move debug.c
[apps/madmutt.git]
/
attach.c
diff --git
a/attach.c
b/attach.c
index
4afb1fb
..
67f2aa4
100644
(file)
--- a/
attach.c
+++ b/
attach.c
@@
-12,35
+12,36
@@
# include "config.h"
#endif
# include "config.h"
#endif
+#include <ctype.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/wait.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
#include <lib-lib/mem.h>
#include <lib-lib/ascii.h>
#include <lib-lib/str.h>
#include <lib-lib/file.h>
#include <lib-lib/macros.h>
#include <lib-lib/mem.h>
#include <lib-lib/ascii.h>
#include <lib-lib/str.h>
#include <lib-lib/file.h>
#include <lib-lib/macros.h>
+#include <lib-lib/debug.h>
+
+#include <lib-mime/mime.h>
+
+#include <lib-ui/curses.h>
+#include <lib-ui/menu.h>
#include "mutt.h"
#include "handler.h"
#include "recvattach.h"
#include "mutt.h"
#include "handler.h"
#include "recvattach.h"
-#include "mutt_menu.h"
-#include "mutt_curses.h"
#include "keymap.h"
#include "rfc1524.h"
#include "keymap.h"
#include "rfc1524.h"
-#include "mime.h"
#include "pager.h"
#include "copy.h"
#include "mx.h"
#include "pager.h"
#include "copy.h"
#include "mx.h"
-#include "mutt_crypt.h"
-
-#include "lib/debug.h"
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/wait.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <string.h>
-#include <errno.h>
+#include <lib-crypt/crypt.h>
int mutt_get_tmp_attachment (BODY * a)
{
int mutt_get_tmp_attachment (BODY * a)
{
@@
-65,7
+66,7
@@
int mutt_get_tmp_attachment (BODY * a)
if ((fpin = fopen (a->filename, "r")) && (fpout = safe_fopen (tempfile, "w"))) { /* __FOPEN_CHECKED__ */
mutt_copy_stream (fpin, fpout);
if ((fpin = fopen (a->filename, "r")) && (fpout = safe_fopen (tempfile, "w"))) { /* __FOPEN_CHECKED__ */
mutt_copy_stream (fpin, fpout);
-
str_replace
(&a->filename, tempfile);
+
m_strreplace
(&a->filename, tempfile);
a->unlink = 1;
if (a->stamp >= st.st_mtime)
a->unlink = 1;
if (a->stamp >= st.st_mtime)
@@
-141,7
+142,7
@@
int mutt_compose_attachment (BODY * a)
b = mutt_read_mime_header (fp, 0);
if (b) {
if (b->parameter) {
b = mutt_read_mime_header (fp, 0);
if (b) {
if (b->parameter) {
-
mutt_free_parameter
(&a->parameter);
+
parameter_delete
(&a->parameter);
a->parameter = b->parameter;
b->parameter = NULL;
}
a->parameter = b->parameter;
b->parameter = NULL;
}
@@
-321,9
+322,11
@@
void mutt_check_lookup_list (BODY * b, char *type, int len)
ascii_strncasecmp (type, t->data, i) == 0) ||
ascii_strcasecmp (type, t->data) == 0) {
ascii_strncasecmp (type, t->data, i) == 0) ||
ascii_strcasecmp (type, t->data) == 0) {
- BODY tmp
= { 0 }
;
+ BODY tmp;
int n;
int n;
+ p_clear(&tmp, 1);
+
if ((n = mutt_lookup_mime_type (&tmp, b->filename)) != TYPEOTHER) {
snprintf (type, len, "%s/%s",
n == TYPEAUDIO ? "audio" :
if ((n = mutt_lookup_mime_type (&tmp, b->filename)) != TYPEOTHER) {
snprintf (type, len, "%s/%s",
n == TYPEAUDIO ? "audio" :
@@
-396,7
+399,7
@@
int mutt_view_attachment (FILE * fp, BODY * a, int flag, HEADER * hdr,
int unlink_tempfile = 0;
is_message = mutt_is_message_type (a->type, a->subtype);
int unlink_tempfile = 0;
is_message = mutt_is_message_type (a->type, a->subtype);
- if (
WithCrypto &&
is_message && a->hdr && (a->hdr->security & ENCRYPT) &&
+ if (is_message && a->hdr && (a->hdr->security & ENCRYPT) &&
!crypt_valid_passphrase (a->hdr->security))
return (rc);
use_mailcap = (flag == M_MAILCAP ||
!crypt_valid_passphrase (a->hdr->security))
return (rc);
use_mailcap = (flag == M_MAILCAP ||
@@
-862,7
+865,7
@@
int mutt_decode_save_attachment (FILE * fp, BODY * m, char *path,
m->length = 0;
m->encoding = saved_encoding;
if (saved_parts) {
m->length = 0;
m->encoding = saved_encoding;
if (saved_parts) {
-
mutt_free_header
(&m->hdr);
+
header_delete
(&m->hdr);
m->parts = saved_parts;
m->hdr = saved_hdr;
}
m->parts = saved_parts;
m->hdr = saved_hdr;
}