Skip to content

Commit

Permalink
fix preset log while enable-logging to false
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis_Fréneau authored and Jovasa committed Apr 10, 2024
1 parent b0be7d5 commit 7424474
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/cfg.c
Expand Up @@ -1112,13 +1112,20 @@ int kvz_config_parse(kvz_config *cfg, const char *name, const char *value)
}

if (preset_values[preset_line][0] != NULL) {
fprintf(stderr, "Using preset %s: ", value);
if (cfg->enable_logging_output) {
fprintf(stderr, "Using preset %s: ", value);
}

// Loop all the name and value pairs and push to the config parser
for (int preset_value = 1; preset_values[preset_line][preset_value] != NULL; preset_value += 2) {
fprintf(stderr, "--%s=%s ", preset_values[preset_line][preset_value], preset_values[preset_line][preset_value + 1]);
if (cfg->enable_logging_output) {
fprintf(stderr, "--%s=%s ", preset_values[preset_line][preset_value], preset_values[preset_line][preset_value + 1]);
}
kvz_config_parse(cfg, preset_values[preset_line][preset_value], preset_values[preset_line][preset_value + 1]);
}
fprintf(stderr, "\n");
if (cfg->enable_logging_output) {
fprintf(stderr, "\n");
}
} else {
fprintf(stderr, "Input error: unknown preset \"%s\"\n", value);
return 0;
Expand Down

0 comments on commit 7424474

Please sign in to comment.