From 5fde02cd887a4dfcc5f7f69f8b4cf950bd655219 Mon Sep 17 00:00:00 2001 From: pdmef Date: Sun, 12 Feb 2006 23:15:56 +0000 Subject: [PATCH] From: Konstantin Sobolev Rocco Rutte: - respect terminal's colors instead of b/w for $allow_ansi git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@782 e385b8ad-14ed-0310-8656-cc95a2468c6d --- VERSION.svn | 2 +- pager.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/VERSION.svn b/VERSION.svn index 394a6cf..fd394dd 100644 --- a/VERSION.svn +++ b/VERSION.svn @@ -1 +1 @@ -781 +782 diff --git a/pager.c b/pager.c index 7bb69ff..dfd4cbe 100644 --- a/pager.c +++ b/pager.c @@ -833,6 +833,8 @@ static int grok_ansi (unsigned char *buf, int pos, ansi_attr * a) a->attr = ANSI_OFF; a->pair = -1; } + a->bg = -2; + a->fg = -2; while (pos < x) { if (buf[pos] == '1' && (pos + 1 == x || buf[pos + 1] == ';')) { a->attr |= ANSI_BOLD; @@ -866,7 +868,8 @@ static int grok_ansi (unsigned char *buf, int pos, ansi_attr * a) #endif a->pair = -1; a->attr |= ANSI_COLOR; - a->fg = buf[pos + 1] - '0'; + if (buf[pos + 1] != '9') + a->fg = buf[pos + 1] - '0'; pos += 3; } else if (buf[pos] == '4' && isdigit (buf[pos + 1])) { @@ -876,7 +879,8 @@ static int grok_ansi (unsigned char *buf, int pos, ansi_attr * a) #endif a->pair = -1; a->attr |= ANSI_COLOR; - a->bg = buf[pos + 1] - '0'; + if (buf[pos + 1] != '9') + a->bg = buf[pos + 1] - '0'; pos += 3; } else { -- 2.20.1