}
/* Decrease a file's modification time by 1 second */
-
time_t mutt_decrease_mtime (const char *f, struct stat *st)
{
struct utimbuf utim;
return mtime;
}
+/* sets mtime of 'to' to mtime of 'from' */
+void mutt_set_mtime (const char* from, const char* to) {
+ struct utimbuf utim;
+ struct stat st;
+
+ if (stat (from, &st) != -1) {
+ utim.actime = st.st_mtime;
+ utim.modtime = st.st_mtime;
+ utime (to, &utim);
+ }
+}
+
const char *mutt_make_version (int full)
{
static char vstring[STRING];
int mutt_cmp_body (const BODY * b1, const BODY * b2);
time_t mutt_decrease_mtime (const char *, struct stat *);
+void mutt_set_mtime (const char*, const char*);
time_t mutt_local_tz (time_t);
time_t mutt_mktime (struct tm *, int);
time_t mutt_parse_date (const char *, HEADER *);
fputs (buf, out);
}
fclose (in);
- unlink (hdr->content->filename);
fclose (out);
+ mutt_set_mtime (hdr->content->filename, tmpfile);
+ unlink (hdr->content->filename);
str_replace (&hdr->content->filename, tmpfile);
}