diff --git a/CHANGES b/CHANGES index e4556d8472..fd55fd0140 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +4205. [bug] 'named-checkconf -p' could include unwanted spaces + when printing tuples with unset optional fields. + [RT #40731] + 4204. [bug] 'dig +trace' failed to lookup the correct type if the initial root ns query was retried. [RT #40296] diff --git a/bin/tests/system/checkconf/good.conf b/bin/tests/system/checkconf/good.conf index cf886a2427..c4320233e1 100644 --- a/bin/tests/system/checkconf/good.conf +++ b/bin/tests/system/checkconf/good.conf @@ -116,7 +116,7 @@ view "second" { zone "." { type redirect; masters { - 1.2.3.4 ; + 1.2.3.4; }; }; dnssec-lookaside "." trust-anchor "dlv.isc.org."; diff --git a/lib/isccfg/parser.c b/lib/isccfg/parser.c index d4167d72d7..17b5c628c3 100644 --- a/lib/isccfg/parser.c +++ b/lib/isccfg/parser.c @@ -272,10 +272,11 @@ cfg_print_tuple(cfg_printer_t *pctx, const cfg_obj_t *obj) { for (f = fields, i = 0; f->name != NULL; f++, i++) { const cfg_obj_t *fieldobj = obj->value.tuple[i]; - if (need_space) + if (need_space && fieldobj->type->rep != &cfg_rep_void) cfg_print_cstr(pctx, " "); cfg_print_obj(pctx, fieldobj); - need_space = ISC_TF(fieldobj->type->print != cfg_print_void); + need_space = ISC_TF(need_space || + fieldobj->type->print != cfg_print_void); } }