projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Clean up code and use m_tempfile instead of mutt_mktemp
[apps/madmutt.git]
/
handler.c
diff --git
a/handler.c
b/handler.c
index
e49d973
..
cc0a3c1
100644
(file)
--- a/
handler.c
+++ b/
handler.c
@@
-1388,10
+1388,9
@@
int mutt_body_handler (BODY * b, STATE * s)
if (!plaintext) {
/* decode to a tempfile, saving the original destination */
fp = s->fpout;
if (!plaintext) {
/* decode to a tempfile, saving the original destination */
fp = s->fpout;
-
mutt_mktemp (tempfile
);
- if (
(s->fpout = safe_fopen (tempfile, "w")) == NULL
) {
+
s->fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL
);
+ if (
!s->fpout
) {
mutt_error _("Unable to open temporary file!");
mutt_error _("Unable to open temporary file!");
-
goto bail;
}
/* decoding the attachment changes the size and offset, so save a copy
goto bail;
}
/* decoding the attachment changes the size and offset, so save a copy
@@
-1407,9
+1406,9
@@
int mutt_body_handler (BODY * b, STATE * s)
s->prefix = NULL;
decode = 1;
s->prefix = NULL;
decode = 1;
- }
- else
+ } else {
b->type = TYPETEXT;
b->type = TYPETEXT;
+ }
mutt_decode_attachment (b, s);
mutt_decode_attachment (b, s);