diff options
author | pommicket <pommicket@gmail.com> | 2023-10-17 10:36:53 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-10-17 10:36:53 -0400 |
commit | 6ea5c07b116b98ebc836a10f88cf908d14c9b6c5 (patch) | |
tree | b9ae3cf7aca9cde2cc69bdc194fa5513664625bb /config.c | |
parent | 9842cb988343d255db17ed57d486ecc41fc0618e (diff) |
new config system seems to be working
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 ")) { |