Source-Changes-HG archive

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

[src/trunk]: src/lib/libcurses _wnoutrefresh - fix current position checks fo...



details:   https://anonhg.NetBSD.org/src/rev/de8eb823f66c
branches:  trunk
changeset: 447277:de8eb823f66c
user:      uwe <uwe%NetBSD.org@localhost>
date:      Sun Jan 06 03:59:17 2019 +0000

description:
_wnoutrefresh - fix current position checks for pads

maxy is an absolute value and should not be adjusted for begy when we
check also absolute cury.  Note that this change does not affect
calculations for normal windows as for them we always pass zero for
begy.  Ditto for x.

diffstat:

 lib/libcurses/refresh.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (31 lines):

diff -r b0c8a3f16d0f -r de8eb823f66c lib/libcurses/refresh.c
--- a/lib/libcurses/refresh.c   Sun Jan 06 03:46:11 2019 +0000
+++ b/lib/libcurses/refresh.c   Sun Jan 06 03:59:17 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: refresh.c,v 1.103 2019/01/06 03:46:11 uwe Exp $        */
+/*     $NetBSD: refresh.c,v 1.104 2019/01/06 03:59:17 uwe 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.103 2019/01/06 03:46:11 uwe Exp $");
+__RCSID("$NetBSD: refresh.c,v 1.104 2019/01/06 03:59:17 uwe Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -218,10 +218,10 @@
 
        /* Check that cursor position on "win" is valid for "__virtscr" */
        if (dwin->cury + wbegy - begy < screen->__virtscr->maxy &&
-           dwin->cury + wbegy - begy >= 0 && dwin->cury < maxy - begy)
+           dwin->cury + wbegy - begy >= 0 && dwin->cury < maxy)
                screen->__virtscr->cury = dwin->cury + wbegy - begy;
        if (dwin->curx + wbegx - begx < screen->__virtscr->maxx &&
-           dwin->curx + wbegx - begx >= 0 && dwin->curx < maxx - begx)
+           dwin->curx + wbegx - begx >= 0 && dwin->curx < maxx)
                screen->__virtscr->curx = dwin->curx + wbegx - begx;
 
        /* Copy the window flags from "win" to "__virtscr" */



Home | Main Index | Thread Index | Old Index