summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'config.c')
-rw-r--r--config.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/config.c b/config.c
index 811fcc9..7518a3b 100644
--- a/config.c
+++ b/config.c
@@ -161,7 +161,7 @@ static const SettingKeyCombo settings_key_combo[] = {
bool config_applies_to(Config *cfg, const char *path, Language language) {
if (cfg->language && language != cfg->language)
return false;
- if (cfg->path && !str_has_path_prefix(path, cfg->path))
+ if (cfg->path && (!path || !str_has_path_prefix(path, cfg->path)))
return false;
return true;
}
@@ -264,6 +264,7 @@ void settings_free(Settings *settings) {
static bool all_set[sizeof(Settings)];
memset(all_set, 1, sizeof all_set);
settings_free_set(settings, all_set);
+ memset(settings, 0, sizeof *settings);
}
static void config_free(Config *cfg) {
@@ -984,7 +985,6 @@ static void config_read_file(Ted *ted, const char *cfg_path, const char ***inclu
cfg = arr_addp(ted->all_configs);
cfg->path = *path ? str_dup(path) : NULL;
cfg->language = language;
- printf("new config:%s(%u)\n",cfg->path,cfg->language);
}
} else if (line[0] == '%') {
if (str_has_prefix(line, "%include ")) {