Fixed default terminal colors usage for NCurses.

This commit is contained in:
Andrew Borodin 2009-03-16 20:14:31 +03:00 committed by Slava Zanko
parent ae33ec6385
commit c572352a04

View File

@ -309,7 +309,9 @@ void init_colors (void)
if (use_colors){ if (use_colors){
start_color (); start_color ();
#ifndef HAVE_SLANG
use_default_colors (); use_default_colors ();
#endif /* !HAVE_SLANG */
configure_colors (); configure_colors ();
#ifndef HAVE_SLANG #ifndef HAVE_SLANG
@ -332,8 +334,8 @@ void init_colors (void)
*/ */
SLtt_set_color (DEFAULT_COLOR_INDEX, NULL, "default", "default"); SLtt_set_color (DEFAULT_COLOR_INDEX, NULL, "default", "default");
#else #else
/* Always white on black */ /* Use default terminal colors */
mc_init_pair(DEFAULT_COLOR_INDEX, COLOR_WHITE, COLOR_BLACK); mc_init_pair (DEFAULT_COLOR_INDEX, -1, -1);
#endif /* !HAVE_SLANG */ #endif /* !HAVE_SLANG */
} }
@ -419,7 +421,7 @@ try_alloc_color_pair (const char *fg, const char *bg)
void void
mc_init_pair (int index, CTYPE foreground, CTYPE background) mc_init_pair (int index, CTYPE foreground, CTYPE background)
{ {
init_pair (index, foreground, (background==0?-1:background)); init_pair (index, foreground, background == 0 ? -1 : background);
if (index > max_index) if (index > max_index)
max_index = index; max_index = index;
} }