From d86282af9c7510e42ab5a3971a5b7c9636d0ca93 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Fri, 1 Jan 2010 01:17:40 -0800 Subject: [PATCH] pretty up ConfDump output for when there is no valid prefix --- src/conf.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/conf.c b/src/conf.c index f16f1fdf36..17e665bbc3 100644 --- a/src/conf.c +++ b/src/conf.c @@ -428,9 +428,16 @@ ConfNodeDump(ConfNode *node, const char *prefix) level++; TAILQ_FOREACH(child, &node->head, next) { name[level] = strdup(child->name); - if (child->val != NULL) - printf("%s.%s = %s\n", prefix, - ConfPrintNameArray(name, level), child->val); + if (child->val != NULL) { + if (prefix == NULL) { + printf("%s = %s\n", ConfPrintNameArray(name, level), + child->val); + } + else { + printf("%s.%s = %s\n", prefix, + ConfPrintNameArray(name, level), child->val); + } + } ConfNodeDump(child, prefix); free(name[level]); }