]> granicus.if.org Git - mutt/commitdiff
Fix ansi escape sequences with both reset and color parameters. (closes #3689)
authorKevin McCarthy <kevin@8t8.us>
Sun, 19 Nov 2017 03:13:08 +0000 (19:13 -0800)
committerKevin McCarthy <kevin@8t8.us>
Sun, 19 Nov 2017 03:13:08 +0000 (19:13 -0800)
The initial 0 "reset/normal" was setting attr = ANSI_OFF, which was
subsequently being or'ed with ANSI_COLOR.

The color resolution was then checking for the ANSI_OFF bit and
turning all coloring off, even though ANSI_COLOR was also set.

Change the color resolution to check for "attr == ANSI_OFF" instead, so
the color isn't reset unless the reset occurs last in the sequence.

pager.c

diff --git a/pager.c b/pager.c
index 4a9ac6a24e80bf3625ebefc699237699c33e2441..7507ea266ccdb2a30fe37f25a163aab64aa69193 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -296,7 +296,7 @@ resolve_color (struct line_t *lineInfo, int n, int cnt, int flags, int special,
     {
       color ^= A_BLINK;
     }
-    else if (a->attr & ANSI_OFF)
+    else if (a->attr == ANSI_OFF)
     {
       a->attr = 0;
     }