From: Konstantin Sobolev <kos@supportwizard.com>
authorpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Sun, 12 Feb 2006 23:15:56 +0000 (23:15 +0000)
committerpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Sun, 12 Feb 2006 23:15:56 +0000 (23:15 +0000)
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
pager.c

index 394a6cf..fd394dd 100644 (file)
@@ -1 +1 @@
-781
+782
diff --git a/pager.c b/pager.c
index 7bb69ff..dfd4cbe 100644 (file)
--- 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 {