summaryrefslogtreecommitdiffstats
path: root/editmsg.c
diff options
context:
space:
mode:
authorGary Johnson <Gary Johnson>2007-08-31 10:12:18 -0700
committerGary Johnson <Gary Johnson>2007-08-31 10:12:18 -0700
commitc1694c7b081b55cb05450e3cd6339f1388025a17 (patch)
treeac7709f4eaa3dcb50980f0b73985ccac42666b85 /editmsg.c
parent98b168ead98323e2be8fd452b1216ea8fd88f43d (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.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/editmsg.c b/editmsg.c
index 67299739..e6c603f5 100644
--- a/editmsg.c
+++ b/editmsg.c
@@ -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)