projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Andreas Krennmair:
[apps/madmutt.git]
/
attach.c
diff --git
a/attach.c
b/attach.c
index
06dc12b
..
d4a3ced
100644
(file)
--- a/
attach.c
+++ b/
attach.c
@@
-108,7
+108,8
@@
int mutt_compose_attachment (BODY *a)
if (mutt_yesorno (_("Can't match nametemplate, continue?"), M_YES) != M_YES)
goto bailout;
}
if (mutt_yesorno (_("Can't match nametemplate, continue?"), M_YES) != M_YES)
goto bailout;
}
- unlink_newfile = 1;
+ else
+ unlink_newfile = 1;
}
else
strfcpy(newfile, a->filename, sizeof(newfile));
}
else
strfcpy(newfile, a->filename, sizeof(newfile));
@@
-173,7
+174,11
@@
int mutt_compose_attachment (BODY *a)
fclose (fp);
fclose (tfp);
mutt_unlink (a->filename);
fclose (fp);
fclose (tfp);
mutt_unlink (a->filename);
- mutt_rename_file (tempfile, a->filename);
+ if (mutt_rename_file (tempfile, a->filename) != 0)
+ {
+ mutt_perror _("Failure to rename file.");
+ goto bailout;
+ }
mutt_free_body (&b);
}
mutt_free_body (&b);
}
@@
-235,7
+240,8
@@
int mutt_edit_attachment (BODY *a)
if (mutt_yesorno (_("Can't match nametemplate, continue?"), M_YES) != M_YES)
goto bailout;
}
if (mutt_yesorno (_("Can't match nametemplate, continue?"), M_YES) != M_YES)
goto bailout;
}
- unlink_newfile = 1;
+ else
+ unlink_newfile = 1;
}
else
strfcpy(newfile, a->filename, sizeof(newfile));
}
else
strfcpy(newfile, a->filename, sizeof(newfile));
@@
-607,6
+613,7
@@
int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr,
rc = mutt_do_pager (descrip, pagerfile,
M_PAGER_ATTACHMENT | (is_message ? M_PAGER_MESSAGE : 0), &info);
rc = mutt_do_pager (descrip, pagerfile,
M_PAGER_ATTACHMENT | (is_message ? M_PAGER_MESSAGE : 0), &info);
+ *pagerfile = '\0';
}
else
rc = 0;
}
else
rc = 0;
@@
-722,6
+729,9
@@
mutt_save_attachment_open (char *path, int flags)
{
if (flags == M_SAVE_APPEND)
return fopen (path, "a");
{
if (flags == M_SAVE_APPEND)
return fopen (path, "a");
+ /* be sure not to change the following fopen to safe_fopen
+ * as safe_fopen returns w/ an error if path exists
+ */
if (flags == M_SAVE_OVERWRITE)
return fopen (path, "w"); /* __FOPEN_CHECKED__ */
if (flags == M_SAVE_OVERWRITE)
return fopen (path, "w"); /* __FOPEN_CHECKED__ */
@@
-848,7
+858,7
@@
int mutt_decode_save_attachment (FILE *fp, BODY *m, char *path,
if (flags == M_SAVE_APPEND)
s.fpout = fopen (path, "a");
else if (flags == M_SAVE_OVERWRITE)
if (flags == M_SAVE_APPEND)
s.fpout = fopen (path, "a");
else if (flags == M_SAVE_OVERWRITE)
- s.fpout =
fopen (path, "w");
/* __FOPEN_CHECKED__ */
+ s.fpout =
safe_fopen (path, "w");
/* __FOPEN_CHECKED__ */
else
s.fpout = safe_fopen (path, "w");
else
s.fpout = safe_fopen (path, "w");