summaryrefslogtreecommitdiff
path: root/usr.bin/mg
diff options
context:
space:
mode:
authorlum <lum@cvs.openbsd.org>2012-05-30 06:13:33 +0000
committerlum <lum@cvs.openbsd.org>2012-05-30 06:13:33 +0000
commita426e60fca3615397b85fe56bcc930ba22c1d8d0 (patch)
tree146e4f8bef415e9c803cefa7b37aa9e4d0629fa1 /usr.bin/mg
parentbdee265c819bded1e78c1352df68b377ae30bd79 (diff)
Reverse part of v1.131. The end of buffer can still be reached so I
shouldn't have taken out the second check. Hopefully fix unpredicable scrolling behaviour seen by mikeb@.
Diffstat (limited to 'usr.bin/mg')
-rw-r--r--usr.bin/mg/basic.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/mg/basic.c b/usr.bin/mg/basic.c
index c657dccb1cb..d5c5d970f61 100644
--- a/usr.bin/mg/basic.c
+++ b/usr.bin/mg/basic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: basic.c,v 1.31 2012/05/25 15:14:38 lum Exp $ */
+/* $OpenBSD: basic.c,v 1.32 2012/05/30 06:13:32 lum Exp $ */
/* This file is in the public domain */
@@ -276,7 +276,7 @@ forwpage(int f, int n)
curwp->w_rflag |= WFFULL;
/* if in current window, don't move dot */
- for (n = curwp->w_ntrows; n--; lp = lforw(lp))
+ for (n = curwp->w_ntrows; n-- && lp != curbp->b_headp; lp = lforw(lp))
if (lp == curwp->w_dotp)
return (TRUE);