[v9_10] spurious spaces in named-checkconf -p

4205.	[bug]		'named-checkconf -p' could include unwanted spaces
			when printing tuples with unset optional fields.
			[RT #40731]
This commit is contained in:
Evan Hunt 2015-09-14 08:53:17 -07:00
parent 4f9619e0d4
commit abfa2247af
3 changed files with 10 additions and 5 deletions

View file

@ -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]

View file

@ -111,7 +111,7 @@ view "second" {
zone "." {
type redirect;
masters {
1.2.3.4 ;
1.2.3.4;
};
};
dnssec-lookaside "." trust-anchor "dlv.isc.org.";

View file

@ -262,10 +262,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)
cfg_print_chars(pctx, " ", 1);
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);
}
}
@ -277,7 +278,7 @@ cfg_doc_tuple(cfg_printer_t *pctx, const cfg_type_t *type) {
for (f = fields; f->name != NULL; f++) {
if (need_space)
cfg_print_chars(pctx, " ", 1);
cfg_print_cstr(pctx, " ");
cfg_doc_obj(pctx, f->type);
need_space = ISC_TF(f->type->print != cfg_print_void);
}