Fix logic to allow for 'none' as object background color.
authorJon Cox <funkymeeba@gmail.com>
Mon, 18 Mar 2019 23:55:45 +0000 (17:55 -0600)
committerJon Cox <funkymeeba@gmail.com>
Mon, 18 Mar 2019 23:55:45 +0000 (17:55 -0600)
Checking for color < 0 doesn't allow for the case where otherwise
valid 'none' value is specified as a background color. I have changed
this to be consistent with the check for the 'color background'
processing.

NEWS
src/Styles.cxx

diff --git a/NEWS b/NEWS
index 8dfdb42..f953de4 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,6 @@
 ncmpc 0.34 - not yet released
 * fix high CPU usage in key bindings check
+* fix background color "none"
 
 ncmpc 0.33 - (2018-10-22)
 * artist page: rename to "library"
index 21a8841..58724d7 100644 (file)
@@ -266,7 +266,7 @@ ParseStyle(StyleData &d, const char *str)
                if (slash != nullptr) {
                        const char *name = slash + 1;
                        short color = ParseBackgroundColor(name);
-                       if (color < 0) {
+                       if (color == COLOR_ERROR) {
                                fprintf(stderr, "%s: %s\n",
                                        _("Unknown color"), name);
                                return false;