summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlum <lum@openbsd.org>2012-06-08 05:10:50 +0000
committerlum <lum@openbsd.org>2012-06-08 05:10:50 +0000
commitbd47b92872ee85e20082029ed528a7f4194a7837 (patch)
tree5c3dd595a2a3d4a7781c6f4ffe85e10cb8da88e8
parentDocument mbsnrtowcs() and wcsnrtombs(). (diff)
downloadwireguard-openbsd-bd47b92872ee85e20082029ed528a7f4194a7837.tar.xz
wireguard-openbsd-bd47b92872ee85e20082029ed528a7f4194a7837.zip
Fix bug where line-number counter would go a bit hay-wire when paging
up with only 1 line of the buffer visible.
-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 932649166ae..c6e5abc5fbe 100644
--- a/usr.bin/mg/basic.c
+++ b/usr.bin/mg/basic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: basic.c,v 1.34 2012/06/01 11:22:06 lum Exp $ */
+/* $OpenBSD: basic.c,v 1.35 2012/06/08 05:10:50 lum Exp $ */
/* This file is in the public domain */
@@ -309,7 +309,7 @@ backpage(int f, int n)
if (!(f & FFARG)) {
n = curwp->w_ntrows - 2; /* Default scroll. */
if (n <= 0) /* Don't blow up if the */
- n = 1; /* window is tiny. */
+ return (backline(f, 1));/* window is tiny. */
} else if (n < 0)
return (forwpage(f | FFRAND, -n));