On Wed, Mar 03, 1999 at 13:45:41 -0500, David Thorburn-Gundlach wrote:
> ...and then Byrial Jensen said...
> % Please try the attached patch to 0.95.1. It sets the time stamp of
> % a new file to `one second ago'.
>
> I have applied this patch to my 0.95.3i sources and it all seems to be
> there, and my abort_unmodified var is set to "yes", but I still have
> to select "q" and say "n" to postponement. Is there something I
> should set differently, or does the patch not really work as
> advertised with 0.95.3i?
Sorry! It doesn't work as advertised with any version because of a
little bug. Please try the patch attached here instead.
Regards,
- Byrial
--- send.c.bak Wed Mar 3 22:11:30 1999
+++ send.c Wed Mar 3 22:18:10 1999
@@ -33,6 +33,9 @@
#include <sys/stat.h>
#include <sys/wait.h>
#include <dirent.h>
+#include <time.h>
+#include <sys/types.h>
+#include <utime.h>
#ifdef _PGPPATH
#include "pgp.h"
@@ -1072,9 +1075,20 @@ ci_send_message (int flags, /* send mod
{
struct stat st;
time_t mtime;
+ struct utimbuf utim;
stat (msg->content->filename, &st);
mtime = st.st_mtime;
+ if (mtime == time (NULL))
+ {
+ /* Decrease the file's modification time by 1 second so we are sure
+ * to find out if the `editor' program changes it in less than 1 second.
+ */
+ mtime -= 1;
+ utim.actime = mtime;
+ utim.modtime = mtime;
+ utime (msg->content->filename, &utim);
+ }
mutt_update_encoding (msg->content);