X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=pager.c;h=dfd4cbe092e16dbe93fe135d33a8dcf5bff89c0f;hp=7bb69ff4274d835b297c8306d6e9f53fa2b22845;hb=b0a700a4558d9bb59395ddcf08565a5e709841e1;hpb=50adaa99ec40c06e557a13394b6f7e62bcc5b9fa 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 {