summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2019-01-24 15:09:41 +0000
committermillert <millert@openbsd.org>2019-01-24 15:09:41 +0000
commitf781121c53754783969cd8dc04b6ffda9b671bd5 (patch)
treee8e4eb9eda55c251610fd6f6cccf8f0074dd32da
parentAdd .fpu directives in inline assembly to silence new compiler (diff)
downloadwireguard-openbsd-f781121c53754783969cd8dc04b6ffda9b671bd5.tar.xz
wireguard-openbsd-f781121c53754783969cd8dc04b6ffda9b671bd5.zip
Fix a crash on long lines when switching to another file by
setting SC_SCR_CENTER which will cause the offsets in HMAP to be reset when painting the screen. OK martijn@ otto@
-rw-r--r--usr.bin/vi/vi/vi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/vi/vi/vi.c b/usr.bin/vi/vi/vi.c
index a8bfec9356d..9059ffe10e6 100644
--- a/usr.bin/vi/vi/vi.c
+++ b/usr.bin/vi/vi/vi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vi.c,v 1.21 2017/04/18 01:45:35 deraadt Exp $ */
+/* $OpenBSD: vi.c,v 1.22 2019/01/24 15:09:41 millert Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -395,6 +395,8 @@ intr: CLR_INTERRUPT(sp);
/* If the last command switched files, change focus. */
if (F_ISSET(sp, SC_FSWITCH)) {
F_CLR(sp, SC_FSWITCH);
+ F_CLR(sp, SC_SCR_TOP);
+ F_SET(sp, SC_SCR_CENTER);
(void)sp->gp->scr_rename(sp, sp->frp->name, 1);
}