From: PatR Date: Tue, 7 Apr 2015 08:23:16 +0000 (-0700) Subject: tty fix for bad curs positioning (-1,n) X-Git-Tag: NetHack-3.6.0_RC01~488^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f5b71c5b8fe9a4e2f26ef5b886219bc2025521da;p=nethack tty fix for bad curs positioning (-1,n) DEBUGFILES set to "wintty.c" reported a bad cursor positioning attempt at the end of the RIP tombstone, and when set to "questpgr.c wintty.c" reported a whole bunch right at the start of the game when enumerating all the quest messages for the chosen role. Both were triggered by this x==0 call to tty_curs() near the end of process_text_window(). if (i == cw->maxrow) { if(cw->type == NHW_TEXT){ tty_curs(BASE_WINDOW, 0, (int)ttyDisplay->cury+1); cl_eos(); } ... The x value is always decremented in tty_curs, so passing in 0 yields a bad value of -1. The bad call returns without doing anything, and when DEBUG is disabled, it does so silently. No fixes entry; it was caused by a post-3.4.3 fix for something else. --- diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 0aaf9e92d..bcf4041e0 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 wintty.c $NHDT-Date: 1427667623 2015/03/29 22:20:23 $ $NHDT-Branch: master $:$NHDT-Revision: 1.75 $ */ +/* NetHack 3.5 wintty.c $NHDT-Date: 1428394244 2015/04/07 08:10:44 $ $NHDT-Branch: master $:$NHDT-Revision: 1.84 $ */ /* NetHack 3.5 wintty.c $Date: 2012/01/22 06:27:09 $ $Revision: 1.66 $ */ /* Copyright (c) David Cohrs, 1991 */ /* NetHack may be freely redistributed. See license for details. */ @@ -1770,7 +1770,7 @@ struct WinDesc *cw; if (i == cw->maxrow) { #ifdef H2344_BROKEN if(cw->type == NHW_TEXT){ - tty_curs(BASE_WINDOW, 0, (int)ttyDisplay->cury+1); + tty_curs(BASE_WINDOW, 1, (int)ttyDisplay->cury+1); cl_eos(); } #endif