Code

The background color can now be assigned to 'none' (use the current color).
[ncmpc.git] / conf.c
diff --git a/conf.c b/conf.c
index 0c0448ed4e9f9200774796ae24332607b4dd371c..1205af5ec6652b28284de06aa5dad07a6331f165 100644 (file)
--- a/conf.c
+++ b/conf.c
@@ -97,8 +97,10 @@ str2color(char *str)
     return COLOR_CYAN;
   else if( !strcasecmp(str,"white") )
     return COLOR_WHITE;
+  else if( !strcasecmp(str,"default") || !strcasecmp(str,"none") )
+    return -1;
   fprintf(stderr,"Warning: unknown color %s\n", str);
-  return -1;
+  return -2;
 }
 
 static int
@@ -330,7 +332,7 @@ read_rc_file(char *filename, options_t *options)
              /* background color */
              else if( !strcasecmp(CONF_COLOR_BACKGROUND, name) )
                {
-                 if( (color=str2color(value)) >= 0 )
+                 if( (color=str2color(value)) >= -1 )
                    options->bg_color = color;
                }
              /* color - top (title) window */