Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libcurses When performing a scroll, check the last line ...



details:   https://anonhg.NetBSD.org/src/rev/88c3044cb329
branches:  trunk
changeset: 372456:88c3044cb329
user:      blymn <blymn%NetBSD.org@localhost>
date:      Wed Nov 30 06:19:15 2022 +0000

description:
When performing a scroll, check the last line of the region is the same
on virtscr and curscr because the indexes past are supposed to be
one *past* the last matching line (they may actually match if the line is
at the bottom of the screen).  Iff they don't match reduce the scroll
region size by one so we don't scroll non-matching lines, also check
if the region is then 0 after the decrement and just return if it was.

diffstat:

 lib/libcurses/refresh.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r b7fe41897b8d -r 88c3044cb329 lib/libcurses/refresh.c
--- a/lib/libcurses/refresh.c   Wed Nov 30 06:07:51 2022 +0000
+++ b/lib/libcurses/refresh.c   Wed Nov 30 06:19:15 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: refresh.c,v 1.124 2022/10/19 06:09:27 blymn Exp $      */
+/*     $NetBSD: refresh.c,v 1.125 2022/11/30 06:19:15 blymn Exp $      */
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)refresh.c  8.7 (Berkeley) 8/13/94";
 #else
-__RCSID("$NetBSD: refresh.c,v 1.124 2022/10/19 06:09:27 blymn Exp $");
+__RCSID("$NetBSD: refresh.c,v 1.125 2022/11/30 06:19:15 blymn Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -1852,6 +1852,13 @@
        ox = curscr->curx;
        n = starts - startw;
 
+       if (!lineeq(__virtscr->alines[startw]->line,
+           curscr->alines[starts]->line, (size_t) __virtscr->maxx))
+               n--;
+
+       if (n == 0)
+               return;
+
        /*
         * XXX
         * The initial tests that set __noqch don't let us reach here unless



Home | Main Index | Thread Index | Old Index