From: Thomas Roessler Date: Thu, 8 Jun 2000 14:39:07 +0000 (+0000) Subject: patch-1.2.bj.ed_mtime.1 X-Git-Tag: mutt-1-3-3-rel~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=57121e3dcc6ab66af4cfc67520a3c35abd8204f5;p=mutt patch-1.2.bj.ed_mtime.1 --- diff --git a/send.c b/send.c index d5f43a70..1ac7bdcf 100644 --- a/send.c +++ b/send.c @@ -33,6 +33,9 @@ #include #include #include +#include +#include +#include #ifdef HAVE_PGP #include "pgp.h" @@ -1223,9 +1226,20 @@ ci_send_message (int flags, /* send mode */ { 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);