summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2012-10-22 08:22:05 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2012-10-22 08:22:05 +0000
commitd801589fb7c8f9f2a6cb773ecfe2409799fc90db (patch)
treeb7828db408416685737da44f2a7ff5214958212e /usr.bin
parente28e0d9c2f03963978e58beeb6ddbedc05628972 (diff)
Check for dirty buffer on buffer change.
ok jasper@, benno@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mg/buffer.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/mg/buffer.c b/usr.bin/mg/buffer.c
index 0cc85f20efe..5f3330c3ee1 100644
--- a/usr.bin/mg/buffer.c
+++ b/usr.bin/mg/buffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: buffer.c,v 1.82 2012/10/12 21:13:46 jasper Exp $ */
+/* $OpenBSD: buffer.c,v 1.83 2012/10/22 08:22:04 florian Exp $ */
/* This file is in the public domain. */
@@ -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)