summaryrefslogtreecommitdiffstats
path: root/attach.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1998-08-28 00:58:25 +0000
committerThomas Roessler <roessler@does-not-exist.org>1998-08-28 00:58:25 +0000
commit18fa8b3cee846a5df29f7c664b9b906cc13c4bd2 (patch)
treedfcaeb1f4c3a52fbd94d6a63ad4fe60a4f379f3b /attach.c
parentf58938adf13af45527dd59838ba9782ba10d033c (diff)
[patch-0.94.4i.tlr.get_attachment.1-2] Get the attachment
time stamping business right.
Diffstat (limited to 'attach.c')
-rw-r--r--attach.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/attach.c b/attach.c
index 275ec3d3..5492d61a 100644
--- a/attach.c
+++ b/attach.c
@@ -46,6 +46,7 @@ int mutt_get_tmp_attachment (BODY *a)
char tempfile[_POSIX_PATH_MAX];
rfc1524_entry *entry = rfc1524_new_entry();
FILE *fpin = NULL, *fpout = NULL;
+ struct stat st;
if(a->unlink)
return 0;
@@ -56,6 +57,9 @@ int mutt_get_tmp_attachment (BODY *a)
tempfile, sizeof(tempfile));
rfc1524_free_entry(&entry);
+
+ if(stat(a->filename, &st) == -1)
+ return -1;
if((fpin = fopen(a->filename, "r")) && (fpout = safe_fopen(tempfile, "w")))
{
@@ -63,6 +67,9 @@ int mutt_get_tmp_attachment (BODY *a)
FREE(&a->filename);
a->filename = safe_strdup(tempfile);
a->unlink = 1;
+
+ if(a->stamp >= st.st_mtime)
+ mutt_stamp_attachment(a);
}
else
mutt_perror(fpin ? tempfile : a->filename);