Skip to content

Commit

Permalink
dird: Fix pretty printing of Options blocks.
Browse files Browse the repository at this point in the history
Print Options inside the for loop and also close it there.

Fixes #591: config pretty-printer does not print filesets correctly
  • Loading branch information
Marco van Wieringen committed Jan 6, 2016
1 parent f3d8602 commit 41fb810
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/dird/dird_conf.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 41fb810

Please sign in to comment.