summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2012-06-30 13:23:02 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2012-06-30 13:25:49 +0200
commit41f70382bdc01778c9db99f0eb66221fc08a71ca (patch)
treebd9d58e28f0ca17e73ef2855b9a7cf28573275da
parent82d86ad7c741c3048c0bccdc18f52576708602a4 (diff)
downloadcalcurse-41f70382bdc01778c9db99f0eb66221fc08a71ca.zip
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>
-rw-r--r--src/config.c6
1 files changed, 5 insertions, 1 deletions
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++) {