mg currently detects a file change behind it's back only when it
resumes (in ttreinit()).
I need this for an upcomming patch which promts
File changed on disk; really edit the buffer (y, n or r)
ok?
--
I'm not entirely sure you are real.
Index: buffer.c
===================================================================
RCS file: /cvs/src/usr.bin/mg/buffer.c,v
retrieving revision 1.82
diff -u -p -r1.82 buffer.c
--- buffer.c 12 Oct 2012 21:13:46 -0000 1.82
+++ buffer.c 13 Oct 2012 22:10:13 -0000
@@ -850,7 +850,11 @@ int
checkdirty(struct buffer *bp)
{
int s;
-
+
+ if ((bp->b_flag & (BFCHG | BFDIRTY)) == 0)
+ if (fchecktime(bp) != TRUE)
+ bp->b_flag |= BFDIRTY;
+
if ((bp->b_flag & (BFDIRTY | BFIGNDIRTY)) == BFDIRTY) {
if ((s = eyorn("File changed on disk; really edit the buffer"))
!= TRUE)