diff --git a/ChangeLog b/ChangeLog index f430738d..86c465fb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,5 @@ 2015-12-18 Benno Schulenberg - * src/color.c (color_init): Use less #ifdefs. + * src/color.c (color_init): Use less #ifdefs, and adjust indentation. 2015-12-11 Benno Schulenberg * doc/syntax/Makefile.am: Add missing autoconf and nftables syntaxes. diff --git a/src/color.c b/src/color.c index a005eebb..7f1b3128 100644 --- a/src/color.c +++ b/src/color.c @@ -116,23 +116,22 @@ void color_init(void) using_defaults = (use_default_colors() != ERR); #endif - for (; tmpcolor != NULL; - tmpcolor = tmpcolor->next) { - foreground = tmpcolor->fg; - background = tmpcolor->bg; + /* For each coloring expression, initialize the color pair. */ + for (; tmpcolor != NULL; tmpcolor = tmpcolor->next) { + foreground = tmpcolor->fg; + background = tmpcolor->bg; - if (foreground == -1 && !using_defaults) - foreground = COLOR_WHITE; + if (foreground == -1 && !using_defaults) + foreground = COLOR_WHITE; - if (background == -1 && !using_defaults) - background = COLOR_BLACK; - - init_pair(tmpcolor->pairnum, foreground, background); + if (background == -1 && !using_defaults) + background = COLOR_BLACK; + init_pair(tmpcolor->pairnum, foreground, background); #ifdef DEBUG fprintf(stderr, "init_pair(): fg = %hd, bg = %hd\n", foreground, background); #endif - } + } } /* Clean up a regex we previously compiled. */