projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use m_tempfile instead of mutt_mktemp
[apps/madmutt.git]
/
handler.c
diff --git
a/handler.c
b/handler.c
index
e49d973
..
0f37639
100644
(file)
--- a/
handler.c
+++ b/
handler.c
@@
-1083,7
+1083,7
@@
static int autoview_handler (BODY * a, STATE * s)
mutt_copy_bytes (s->fpin, fpin, a->length);
if (!piped) {
mutt_copy_bytes (s->fpin, fpin, a->length);
if (!piped) {
-
safe_fclose
(&fpin);
+
m_fclose
(&fpin);
thepid = mutt_create_filter (command, NULL, &fpout, &fperr);
}
else {
thepid = mutt_create_filter (command, NULL, &fpout, &fperr);
}
else {
@@
-1140,12
+1140,12
@@
static int autoview_handler (BODY * a, STATE * s)
}
bail:
}
bail:
-
safe_fclose
(&fpout);
-
safe_fclose
(&fperr);
+
m_fclose
(&fpout);
+
m_fclose
(&fperr);
mutt_wait_filter (thepid);
if (piped)
mutt_wait_filter (thepid);
if (piped)
-
safe_fclose
(&fpin);
+
m_fclose
(&fpin);
else
mutt_unlink (tempfile);
else
mutt_unlink (tempfile);
@@
-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);