projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
safe_fclose -> m_fclose, and is now inlined.
[apps/madmutt.git]
/
commands.c
diff --git
a/commands.c
b/commands.c
index
2be0260
..
e0dfe2e
100644
(file)
--- a/
commands.c
+++ b/
commands.c
@@
-19,13
+19,13
@@
#include <lib-ui/curses.h>
#include <lib-ui/enter.h>
#include <lib-ui/menu.h>
#include <lib-ui/curses.h>
#include <lib-ui/enter.h>
#include <lib-ui/menu.h>
+#include <lib-mx/mx.h>
#include "mutt.h"
#include "alias.h"
#include "recvattach.h"
#include "sort.h"
#include "copy.h"
#include "mutt.h"
#include "alias.h"
#include "recvattach.h"
#include "sort.h"
#include "copy.h"
-#include "mx.h"
#include "pager.h"
#include <lib-crypt/crypt.h>
#include "mutt_idna.h"
#include "pager.h"
#include <lib-crypt/crypt.h>
#include "mutt_idna.h"
@@
-55,11
+55,10
@@
int mutt_display_message (HEADER * cur)
mutt_parse_mime_message (Context, cur);
mutt_message_hook (Context, cur, M_MESSAGEHOOK);
mutt_parse_mime_message (Context, cur);
mutt_message_hook (Context, cur, M_MESSAGEHOOK);
-
mutt_mktemp (tempfile
);
- if (
(fpout = safe_fopen (tempfile, "w")) == NULL
) {
+
fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL
);
+ if (
!fpout
) {
mutt_error _("Could not create temporary file!");
mutt_error _("Could not create temporary file!");
-
- return (0);
+ return 0;
}
if (DisplayFilter && *DisplayFilter) {
}
if (DisplayFilter && *DisplayFilter) {
@@
-70,7
+69,7
@@
int mutt_display_message (HEADER * cur)
-1, fileno (fpfilterout), -1);
if (filterpid < 0) {
mutt_error (_("Cannot create display filter"));
-1, fileno (fpfilterout), -1);
if (filterpid < 0) {
mutt_error (_("Cannot create display filter"));
-
safe_fclose
(&fpfilterout);
+
m_fclose
(&fpfilterout);
unlink (tempfile);
return 0;
}
unlink (tempfile);
return 0;
}
@@
-129,11
+128,11
@@
int mutt_display_message (HEADER * cur)
mx_close_message (&msg);
}
mx_close_message (&msg);
}
- if ((
safe_fclose
(&fpout) != 0 && errno != EPIPE) || res == -1) {
+ if ((
m_fclose
(&fpout) != 0 && errno != EPIPE) || res == -1) {
mutt_error (_("Could not copy message"));
if (fpfilterout != NULL) {
mutt_wait_filter (filterpid);
mutt_error (_("Could not copy message"));
if (fpfilterout != NULL) {
mutt_wait_filter (filterpid);
-
safe_fclose
(&fpfilterout);
+
m_fclose
(&fpfilterout);
}
#if 0
/* this is maybe just plain wrong but it makes the pager display
}
#if 0
/* this is maybe just plain wrong but it makes the pager display
@@
-150,7
+149,7
@@
int mutt_display_message (HEADER * cur)
if (fpfilterout != NULL && mutt_wait_filter (filterpid) != 0)
mutt_any_key_to_continue (NULL);
if (fpfilterout != NULL && mutt_wait_filter (filterpid) != 0)
mutt_any_key_to_continue (NULL);
-
safe_fclose
(&fpfilterout); /* XXX - check result? */
+
m_fclose
(&fpfilterout); /* XXX - check result? */
/* update crypto information for this message */
/* update crypto information for this message */
@@
-390,7
+389,7
@@
static int _mutt_pipe_message(HEADER * h, char *cmd, int decode, int print,
/* add the message separator */
if (sep)
fputs (sep, fpout);
/* add the message separator */
if (sep)
fputs (sep, fpout);
-
safe_fclose
(&fpout);
+
m_fclose
(&fpout);
if (mutt_wait_filter (thepid) != 0)
rc = 1;
}
if (mutt_wait_filter (thepid) != 0)
rc = 1;
}
@@
-413,7
+412,7
@@
static int _mutt_pipe_message(HEADER * h, char *cmd, int decode, int print,
fputs (sep, fpout);
}
}
fputs (sep, fpout);
}
}
-
safe_fclose
(&fpout);
+
m_fclose
(&fpout);
if (mutt_wait_filter (thepid) != 0)
rc = 1;
}
if (mutt_wait_filter (thepid) != 0)
rc = 1;
}