summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2014-12-14 18:21:40 -0300
committerdequis <dx@dxzone.com.ar>2014-12-14 18:21:40 -0300
commit367d8efc5ffca32ce6a6407fddb5253ed9eab1a4 (patch)
treef3f5049fe92642d61325ecffbd98f3336ec500d7 /src
parentdbcfb7060b48a9618d226daaa9fe407dc684ecc5 (diff)
downloadirssi-367d8efc5ffca32ce6a6407fddb5253ed9eab1a4.zip
Fix blinking/bold text in terminals with no color support
Before this, doing "TERM=vt100 irssi" showed all text as bold and blinking because of a failed check of window->term->TI_colors that was doing (value & 8) and not expecting a value of 0. The changed lines themselves look a bit weird, but they make more sense in the context of the original commit, 96a292d4.
Diffstat (limited to 'src')
-rw-r--r--src/fe-text/term-terminfo.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/fe-text/term-terminfo.c b/src/fe-text/term-terminfo.c
index 29d3f7eb..ded79c28 100644
--- a/src/fe-text/term-terminfo.c
+++ b/src/fe-text/term-terminfo.c
@@ -390,7 +390,8 @@ void term_set_color(TERM_WINDOW *window, int col)
}
/* set background color */
- if (window && (term_color256map[bg&0xff]&8) == window->term->TI_colors)
+ if (window && window->term->TI_colors &&
+ (term_color256map[bg&0xff]&8) == window->term->TI_colors)
col |= ATTR_BLINK;
if (col & ATTR_BLINK)
current_term->set_blink(current_term);
@@ -413,7 +414,8 @@ void term_set_color(TERM_WINDOW *window, int col)
terminfo_set_reverse();
/* bold */
- if (window && (term_color256map[fg&0xff]&8) == window->term->TI_colors)
+ if (window && window->term->TI_colors &&
+ (term_color256map[fg&0xff]&8) == window->term->TI_colors)
col |= ATTR_BOLD;
if (col & ATTR_BOLD)
terminfo_set_bold();