From 7c20bf4afa6e4a62c5610b5bb8548f57730a8153 Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 7 Dec 2023 02:52:41 -0800 Subject: [PATCH] tty: term_start_color(NO_COLOR) Make term_start_color() more versatile. If it gets passed NO_COLOR then it performs term_end_color(). Should be able to streamline some of the color handling this way although this hasn't done so. --- win/tty/termcap.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/win/tty/termcap.c b/win/tty/termcap.c index c205b43b5..6a2a0be4e 100644 --- a/win/tty/termcap.c +++ b/win/tty/termcap.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 termcap.c $NHDT-Date: 1609459769 2021/01/01 00:09:29 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.41 $ */ +/* NetHack 3.7 termcap.c $NHDT-Date: 1701946349 2023/12/07 10:52:29 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.60 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Pasi Kallinen, 2018. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1429,7 +1429,9 @@ term_end_color(void) void term_start_color(int color) { - if (color < CLR_MAX && hilites[color] && *hilites[color]) + if (color == NO_COLOR) + xputs(nh_HE); /* inline term_end_color() */ + else if (color < CLR_MAX && hilites[color] && *hilites[color]) xputs(hilites[color]); }