From 3d50a058b9acb3749dc372e84f307a2e1ccd9553 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 29 Oct 2001 19:16:14 +0000 Subject: [PATCH] when colors aren't used, don't save last_fg and last_bg. This helps at least clrtoeol(). git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1942 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-text/term-terminfo.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/fe-text/term-terminfo.c b/src/fe-text/term-terminfo.c index 56ae53c1..9f8b3b6f 100644 --- a/src/fe-text/term-terminfo.c +++ b/src/fe-text/term-terminfo.c @@ -224,9 +224,10 @@ void term_set_color(TERM_WINDOW *window, int col) /* set foreground color */ if ((col & 0x0f) != last_fg && ((col & 0x0f) != 0 || (col & ATTR_RESETFG) == 0)) { - last_fg = col & 0x0f; - if (term_use_colors) + if (term_use_colors) { + last_fg = col & 0x0f; terminfo_set_fg(last_fg); + } } /* set background color */ @@ -237,9 +238,10 @@ void term_set_color(TERM_WINDOW *window, int col) if ((col & 0xf0) >> 4 != last_bg && ((col & 0xf0) != 0 || (col & ATTR_RESETBG) == 0)) { - last_bg = (col & 0xf0) >> 4; - if (term_use_colors) + if (term_use_colors) { terminfo_set_bg(last_bg); + last_bg = (col & 0xf0) >> 4; + } } /* bold */