From 2a0e5679311c156ba6e559336f80ec0077f4c571 Mon Sep 17 00:00:00 2001 From: pdmef Date: Tue, 30 Aug 2005 21:22:54 +0000 Subject: [PATCH] Rocco Rutte: - make $abort_unmodified work again by copying mtimes git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@469 e385b8ad-14ed-0310-8656-cc95a2468c6d --- VERSION.svn | 2 +- muttlib.c | 13 ++++++++++++- protos.h | 1 + rfc3676.c | 3 ++- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/VERSION.svn b/VERSION.svn index 1023289..5ef9d24 100644 --- a/VERSION.svn +++ b/VERSION.svn @@ -1 +1 @@ -468 +469 diff --git a/muttlib.c b/muttlib.c index d5bd3b7..a36e8da 100644 --- a/muttlib.c +++ b/muttlib.c @@ -1262,7 +1262,6 @@ void mutt_sleep (short s) } /* Decrease a file's modification time by 1 second */ - time_t mutt_decrease_mtime (const char *f, struct stat *st) { struct utimbuf utim; @@ -1285,6 +1284,18 @@ time_t mutt_decrease_mtime (const char *f, struct stat *st) 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]; diff --git a/protos.h b/protos.h index 6d23e83..44b7cbb 100644 --- a/protos.h +++ b/protos.h @@ -81,6 +81,7 @@ int mutt_cmp_param (const PARAMETER * p1, const PARAMETER * p2); 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 *); diff --git a/rfc3676.c b/rfc3676.c index 805ff71..9b626ce 100644 --- a/rfc3676.c +++ b/rfc3676.c @@ -256,7 +256,8 @@ void rfc3676_space_stuff (HEADER* hdr) { 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); } -- 2.20.1