From: PatR Date: Tue, 1 Feb 2022 02:31:34 +0000 (-0800) Subject: tty_raw_print_bold() again X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0e6456c9f40a6638938224501665520ea9332cdf;p=nethack tty_raw_print_bold() again Redo the tty handling for raw_print_bold() intended to keep it working after exit_nhwindows(). Don't assign static addresses to nh_HI and nh_HE in case the routine to free dynamic termcap data somehow gets called again. --- diff --git a/win/tty/termcap.c b/win/tty/termcap.c index 9be89d9c7..231518fb6 100644 --- a/win/tty/termcap.c +++ b/win/tty/termcap.c @@ -1375,24 +1375,25 @@ term_end_attr(int attr) } } +/* this is called 'start bold' but HI is derived from SO (standout) rather + than from MD (start bold attribute) */ void term_start_raw_bold(void) { - if (!nh_HI) - nh_HI = tty_standout_on; + const char *soOn = nh_HI ? nh_HI : tty_standout_on; - if (*nh_HI) - xputs(nh_HI); + if (*soOn) + xputs(soOn); } +/* this is called 'end bold' but HE is derived from ME (end all attributes) */ void term_end_raw_bold(void) { - if (!nh_HE) - nh_HE = tty_standout_off; + const char *soOff = nh_HE ? nh_HE : tty_standout_off; - if (*nh_HE) - xputs(nh_HE); + if (*soOff) + xputs(soOff); } #ifdef TEXTCOLOR