Hi all,
well, here's one obvious fix, at least:
--
Index: common/options.c
===================================================================
RCS file: /cvs/src/usr.bin/vi/common/options.c,v
retrieving revision 1.28
diff -u -p -r1.28 options.c
--- common/options.c 30 Apr 2020 10:40:21 -0000 1.28
+++ common/options.c 12 Apr 2021 15:37:09 -0000
@@ -182,7 +182,7 @@ OPTLIST const optlist[] = {
/* O_WARN 4BSD */
{"warn", NULL, OPT_1BOOL, 0},
/* O_WINDOW 4BSD */
- {"window", f_window, OPT_NUM, 0},
+ {"window", f_window, OPT_NUM, OPT_NOZERO},
/* O_WINDOWNAME 4BSD */
{"windowname", NULL, OPT_0BOOL, 0},
/* O_WRAPLEN 4.4BSD */
--
I managed to replicate the bug, but not consistently. Anyway, the
offender was a conditional statement in vs_refresh.c:
262: } else if (LNO > TMAP->lno) {
which makes me suspect that either sp->lno or TMAP->lno aren't properly
initialized when the bug occurs.
Erik