* please see the file GPL in the top level source directory.
*/
-#if HAVE_CONFIG_H
-# 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/lib-lib.h>
#include <lib-sys/unix.h>
-
#include <lib-mime/mime.h>
-
#include <lib-ui/curses.h>
#include <lib-ui/menu.h>
+#include <lib-mx/mx.h>
#include "mutt.h"
#include "handler.h"
#include "keymap.h"
#include "pager.h"
#include "copy.h"
-#include "mx.h"
#include <lib-crypt/crypt.h>
int mutt_get_tmp_attachment (BODY * a)
if (r != -1 && entry->composetypecommand) {
BODY *b;
FILE *fp, *tfp;
- char tempfile[_POSIX_PATH_MAX];
if ((fp = safe_fopen (a->filename, "r")) == NULL) {
mutt_perror (_("Failure to open file to parse headers."));
b = mutt_read_mime_header (fp, 0);
if (b) {
+ char tempfile[_POSIX_PATH_MAX];
+
if (b->parameter) {
parameter_list_wipe(&a->parameter);
a->parameter = b->parameter;
/* Remove headers by copying out data to another file, then
* copying the file back */
fseeko (fp, b->offset, 0);
- mutt_mktemp (tempfile);
- if ((tfp = safe_fopen (tempfile, "w")) == NULL) {
+ tfp = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+ if (!tfp) {
mutt_perror (_("Failure to open file to strip headers."));
-
goto bailout;
}
mutt_copy_stream (fp, tfp);