projects
/
apps
/
madmutt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fcaada9
)
mutt_mktemp--
author
Pierre Habouzit
<madcoder@debian.org>
Fri, 24 Nov 2006 22:34:37 +0000
(23:34 +0100)
committer
Pierre Habouzit
<madcoder@debian.org>
Fri, 24 Nov 2006 22:34:37 +0000
(23:34 +0100)
attach.c
patch
|
blob
|
history
diff --git
a/attach.c
b/attach.c
index
118edfa
..
9114d86
100644
(file)
--- a/
attach.c
+++ b/
attach.c
@@
-111,7
+111,6
@@
int mutt_compose_attachment (BODY * a)
if (r != -1 && entry->composetypecommand) {
BODY *b;
FILE *fp, *tfp;
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."));
if ((fp = safe_fopen (a->filename, "r")) == NULL) {
mutt_perror (_("Failure to open file to parse headers."));
@@
-121,6
+120,8
@@
int mutt_compose_attachment (BODY * a)
b = mutt_read_mime_header (fp, 0);
if (b) {
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;
if (b->parameter) {
parameter_list_wipe(&a->parameter);
a->parameter = b->parameter;
@@
-140,10
+141,9
@@
int mutt_compose_attachment (BODY * a)
/* Remove headers by copying out data to another file, then
* copying the file back */
fseeko (fp, b->offset, 0);
/* 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."));
mutt_perror (_("Failure to open file to strip headers."));
-
goto bailout;
}
mutt_copy_stream (fp, tfp);
goto bailout;
}
mutt_copy_stream (fp, tfp);