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>
This commit is contained in:
parent
82d86ad7c7
commit
41f70382bd
@ -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++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user