aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cfg.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/cfg.c b/cfg.c
index 832b196..2ed3844 100644
--- a/cfg.c
+++ b/cfg.c
@@ -673,6 +673,26 @@ static int cfg_read(const char *file)
}
+static void cfg_dump(void)
+{
+ int i, len;
+
+ /* find longest key for pretty output */
+ len = 1;
+ for (i = 0; i < nConfig; i++) {
+ int l = strlen(Config[i].key);
+ if (l > len)
+ len = l;
+ }
+
+ info("Dump of %s:", Config_File);
+ for (i = 0; i < nConfig; i++) {
+ info(" %-*s %s", len, Config[i].key, Config[i].val);
+ }
+ info("");
+}
+
+
int cfg_init(const char *file)
{
if (cfg_check_source(file) == -1) {
@@ -684,8 +704,12 @@ int cfg_init(const char *file)
if (Config_File)
free(Config_File);
+
Config_File = strdup(file);
+ if (verbose_level > 1)
+ cfg_dump();
+
return 0;
}