From b67e363cde8e0e4ce49e6d3bfc6ba1cd4b2ca1fe Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sun, 10 Mar 2002 14:22:59 +0000 Subject: [PATCH] Foreground ANSI colors weren't working git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2548 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/core/formats.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/fe-common/core/formats.c b/src/fe-common/core/formats.c index 8991164a..d70bcc45 100644 --- a/src/fe-common/core/formats.c +++ b/src/fe-common/core/formats.c @@ -729,8 +729,10 @@ static const char *get_ansi_color(THEME_REC *theme, const char *str, flags |= GUI_PRINT_FLAG_REVERSE; break; default: - if (num >= 30 && num <= 37) + if (num >= 30 && num <= 37) { + if (fg == -1) fg = 0; fg = (fg & 0xf8) | ansitab[num-30]; + } if (num >= 40 && num <= 47) { if (bg == -1) bg = 0; bg = (bg & 0xf8) | ansitab[num-40]; @@ -875,8 +877,10 @@ char *strip_codes(const char *input) } } - if (*p == 27 && p[1] != '\0') + if (*p == 27 && p[1] != '\0') { + p++; p = get_ansi_color(current_theme, p, NULL, NULL, NULL); + } if (!IS_COLOR_CODE(*p)) *out++ = *p;