diff options
author | Gary Johnson <Gary Johnson> | 2007-08-31 10:12:18 -0700 |
---|---|---|
committer | Gary Johnson <Gary Johnson> | 2007-08-31 10:12:18 -0700 |
commit | c1694c7b081b55cb05450e3cd6339f1388025a17 (patch) | |
tree | ac7709f4eaa3dcb50980f0b73985ccac42666b85 /editmsg.c | |
parent | 98b168ead98323e2be8fd452b1216ea8fd88f43d (diff) |
Decrement the mtime of the tempfile during edit-message to make mutt
notice changes taking less than one second.
Diffstat (limited to 'editmsg.c')
-rw-r--r-- | editmsg.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -91,8 +91,11 @@ static int edit_one_message (CONTEXT *ctx, HEADER *cur) goto bail; } - if (stat (tmp, &sb) == 0) - mtime = sb.st_mtime; + if ((rc = stat (tmp, &sb)) == -1) + { + mutt_error (_("Can't stat %s: %s"), tmp, strerror (errno)); + goto bail; + } /* * 2002-09-05 me@sigpipe.org @@ -109,6 +112,8 @@ static int edit_one_message (CONTEXT *ctx, HEADER *cur) goto bail; } + mtime = mutt_decrease_mtime (tmp, &sb); + mutt_edit_file (NONULL(Editor), tmp); if ((rc = stat (tmp, &sb)) == -1) |