Rocco Rutte:
authorpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Tue, 30 Aug 2005 21:22:54 +0000 (21:22 +0000)
committerpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Tue, 30 Aug 2005 21:22:54 +0000 (21:22 +0000)
- 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
muttlib.c
protos.h
rfc3676.c

index 1023289..5ef9d24 100644 (file)
@@ -1 +1 @@
-468
+469
index d5bd3b7..a36e8da 100644 (file)
--- 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];
index 6d23e83..44b7cbb 100644 (file)
--- 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 *);
index 805ff71..9b626ce 100644 (file)
--- 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);
 }