color fix (final!)



This patch fixes a long-standing problem regarding colors in
stable and CVS versions of mc. If your terminal is not listed
in color_terminals (src/slint.c:450), colors won't be enabled
unless you force them with -c. The problem is that mc always
overrides the value of the SLtt_Use_Ansi_Colors variable,
which is already initialized by slang.

Here's a patch to fix it, against the 2002-06-11-11 snapshot.
(With different line numbers it will work against 4.5.55 too.)
I tested it and it works fine (also no compilation warnings).
Please let me know what do you decide to do with it.

Oskar Liljeblad (oskar osk mine nu)

--- slint.c.old Thu Jun 13 10:07:04 2002
+++ slint.c     Thu Jun 13 10:07:23 2002
@@ -472,7 +472,8 @@
     char *cts = color_terminal_string, *s;
     int  i;

-    SLtt_Use_Ansi_Colors = force_colors;
+    if (force_colors)
+       SLtt_Use_Ansi_Colors = 1;
     if (NULL != getenv ("COLORTERM"))
        SLtt_Use_Ansi_Colors = 1;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]