mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-03 16:15:27 +00:00
don't print extra spaces at omitted optional fields
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: parser.c,v 1.34 2001/03/01 03:10:08 gson Exp $ */
|
/* $Id: parser.c,v 1.35 2001/03/01 03:22:12 gson Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -275,6 +275,9 @@ get_addr(cfg_parser_t *pctx, unsigned int flags, isc_netaddr_t *na);
|
|||||||
static void
|
static void
|
||||||
print(cfg_printer_t *pctx, const char *text, int len);
|
print(cfg_printer_t *pctx, const char *text, int len);
|
||||||
|
|
||||||
|
static void
|
||||||
|
print_void(cfg_printer_t *pctx, cfg_obj_t *obj);
|
||||||
|
|
||||||
static isc_result_t
|
static isc_result_t
|
||||||
parse_mapbody(cfg_parser_t *pctx, cfg_type_t *type, cfg_obj_t **ret);
|
parse_mapbody(cfg_parser_t *pctx, cfg_type_t *type, cfg_obj_t **ret);
|
||||||
|
|
||||||
@@ -1113,11 +1116,14 @@ print_tuple(cfg_printer_t *pctx, cfg_obj_t *obj) {
|
|||||||
unsigned int i;
|
unsigned int i;
|
||||||
cfg_tuplefielddef_t *fields = obj->type->of;
|
cfg_tuplefielddef_t *fields = obj->type->of;
|
||||||
cfg_tuplefielddef_t *f;
|
cfg_tuplefielddef_t *f;
|
||||||
|
isc_boolean_t need_space = ISC_FALSE;
|
||||||
|
|
||||||
for (f = fields, i = 0; f->name != NULL; f++, i++) {
|
for (f = fields, i = 0; f->name != NULL; f++, i++) {
|
||||||
print_obj(pctx, obj->value.tuple[i]);
|
cfg_obj_t *fieldobj = obj->value.tuple[i];
|
||||||
if (f[1].name != NULL)
|
if (need_space)
|
||||||
print(pctx, " ", 1);
|
print(pctx, " ", 1);
|
||||||
|
print_obj(pctx, fieldobj);
|
||||||
|
need_space = ISC_TF(fieldobj->type->print != print_void);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user