summaryrefslogtreecommitdiffstats
path: root/contrib/nvi/vi/vs_line.c
diff options
context:
space:
mode:
authorsheldonh <sheldonh@FreeBSD.org>2002-01-31 13:28:37 +0000
committersheldonh <sheldonh@FreeBSD.org>2002-01-31 13:28:37 +0000
commit6122421847de7afa5fb3c70ddf001fb674e4d9e3 (patch)
tree72da00fe7d47c53e6b1fc7d9b2464d169a40b7f4 /contrib/nvi/vi/vs_line.c
parentfa30b82df1e06e2a03c19d29525f6b924efdeb0e (diff)
downloadFreeBSD-src-6122421847de7afa5fb3c70ddf001fb674e4d9e3.zip
FreeBSD-src-6122421847de7afa5fb3c70ddf001fb674e4d9e3.tar.gz
Fix core dump in left-right screen scrolling for long lines.
The nvi maintainer expects this patch to be included in the upcoming nvi-1.81.6 unless a better fix presents itself. The MFC reminder below should be taken as a cue to MFC rev 1.1.1.2 of vs_relative.c as well. PR: bin/26869 Reported by: Alex Semenyaka <alexs@snark.ratmir.ru> Obtained from: skimo@kotnet.org (via "Alexey V. Neyman" <alex.neyman@auriga.ru>) MFC after: 1 month
Diffstat (limited to 'contrib/nvi/vi/vs_line.c')
-rw-r--r--contrib/nvi/vi/vs_line.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/nvi/vi/vs_line.c b/contrib/nvi/vi/vs_line.c
index b439de9..e48d5ef 100644
--- a/contrib/nvi/vi/vs_line.c
+++ b/contrib/nvi/vi/vs_line.c
@@ -267,7 +267,10 @@ empty: (void)gp->scr_addstr(sp,
cols_per_screen = sp->cols;
/* Put starting info for this line in the cache. */
- if (scno != skip_cols) {
+ if (offset_in_line >= len) {
+ smp->c_sboff = offset_in_line;
+ smp->c_scoff = 255;
+ } else if (scno != skip_cols) {
smp->c_sboff = offset_in_line;
smp->c_scoff =
offset_in_char = chlen - (scno - skip_cols);
OpenPOWER on IntegriCloud