]> git.wh0rd.org Git - nano.git/commitdiff
Adjusting the whitespace after the previous change, and adding a comment.
authorBenno Schulenberg <bensberg@justemail.net>
Fri, 18 Dec 2015 10:45:35 +0000 (10:45 +0000)
committerBenno Schulenberg <bensberg@justemail.net>
Fri, 18 Dec 2015 10:45:35 +0000 (10:45 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5496 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/color.c

index f430738db164b83482e530db5c58506ff006b134..86c465fbec52bf874adfb03fc88160a961b2f74a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,5 @@
 2015-12-18  Benno Schulenberg  <bensberg@justemail.net>
-       * src/color.c (color_init): Use less #ifdefs.
+       * src/color.c (color_init): Use less #ifdefs, and adjust indentation.
 
 2015-12-11  Benno Schulenberg  <bensberg@justemail.net>
        * doc/syntax/Makefile.am: Add missing autoconf and nftables syntaxes.
index a005eebb00789332b37378f70919375e61299f1c..7f1b3128bbebae04df2b575fc61c76aeeb1e28e7 100644 (file)
@@ -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;
-
-           if (foreground == -1 && !using_defaults)
-                   foreground = COLOR_WHITE;
+    /* For each coloring expression, initialize the color pair. */
+    for (; tmpcolor != NULL; tmpcolor = tmpcolor->next) {
+       foreground = tmpcolor->fg;
+       background = tmpcolor->bg;
 
-           if (background == -1 && !using_defaults)
-                   background = COLOR_BLACK;
+       if (foreground == -1 && !using_defaults)
+           foreground = COLOR_WHITE;
 
-           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. */