From 41fb810bded3ac2df61c7d6d7b9b497e70338d39 Mon Sep 17 00:00:00 2001 From: Marco van Wieringen Date: Wed, 6 Jan 2016 13:03:27 +0100 Subject: [PATCH] dird: Fix pretty printing of Options blocks. Print Options inside the for loop and also close it there. Fixes #591: config pretty-printer does not print filesets correctly --- src/dird/dird_conf.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/dird/dird_conf.c b/src/dird/dird_conf.c index 1804a8b51b1..fa34b47ef98 100644 --- a/src/dird/dird_conf.c +++ b/src/dird/dird_conf.c @@ -1284,20 +1284,18 @@ bool FILESETRES::print_config(POOL_MEM &buff, bool hide_sensitive_data) for (int i = 0; i < num_includes; i++) { INCEXE *incexe = include_items[i]; - Mmsg(temp, "Include {\n"); - indent_config_item(cfg_str, 1, temp.c_str()); + indent_config_item(cfg_str, 1, "Include {\n"); /* * Start options block */ if (incexe->num_opts > 0) { - Mmsg(temp, "Options {\n"); - indent_config_item(cfg_str, 2, temp.c_str()); - for (int j = 0; j < incexe->num_opts; j++) { FOPTS *fo = incexe->opts_list[j]; bool enhanced_wild = false; + indent_config_item(cfg_str, 2, "Options {\n"); + for (int k = 0; fo->opts[k] != '\0'; k++) { if (fo->opts[k]=='W') { enhanced_wild = true; @@ -1554,9 +1552,7 @@ bool FILESETRES::print_config(POOL_MEM &buff, bool hide_sensitive_data) Mmsg(temp, "Writer = \"%s\"\n", fo->writer); indent_config_item(cfg_str, 3, temp.c_str()); } - } - if (incexe->num_opts > 0) { indent_config_item(cfg_str, 2, "}\n"); } } /* end options block */