From 41f70382bdc01778c9db99f0eb66221fc08a71ca Mon Sep 17 00:00:00 2001
From: Lukas Fleischer <calcurse@cryptocrack.de>
Date: Sat, 30 Jun 2012 13:23:02 +0200
Subject: src/config.c: Fix parsing an unset color theme

If color support is disabled, the color theme configuration value is set
to "0" or "none", which is a value we no longer accepted since commit
a5486605696f92a749277d49c77bb5b194dc67a5. Re-introduce the branch that
checks for an unset color theme before actually parsing it.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
---
 src/config.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'src')

diff --git a/src/config.c b/src/config.c
index a25cae1..06a8124 100644
--- a/src/config.c
+++ b/src/config.c
@@ -221,6 +221,10 @@ static int config_parse_first_day_of_week(void *dummy, const char *val)
 static int config_parse_color_theme(void *dummy, const char *val)
 {
   int color1, color2;
+  if (!strcmp(val, "0") || !strcmp(val, "none")) {
+    colorize = 0;
+    return 1;
+  }
   if (!config_parse_color_pair(&color1, &color2, val))
     return 0;
   init_pair(COLR_CUSTOM, color1, color2);
@@ -337,7 +341,7 @@ static void config_color_theme_name(char *theme_name)
   };
 
   if (!colorize)
-    strncpy(theme_name, "0", BUFSIZ);
+    strncpy(theme_name, "none", BUFSIZ);
   else {
     pair_content(COLR_CUSTOM, &color[0], &color[1]);
     for (i = 0; i < NBCOLORS; i++) {
-- 
cgit v1.2.3-70-g09d2