Commit 74bc3f2a authored by Bob Halley's avatar Bob Halley
Browse files

optional use of initial whitespace

parent 62305d91
......@@ -393,20 +393,25 @@ printquestions(dns_namelist_t *section) {
static dns_result_t
printsection(dns_namelist_t *section, char *section_name) {
dns_name_t *name;
dns_name_t *name, *print_name;
dns_rdatalist_t *rdatalist;
dns_rdataset_t rdataset;
isc_buffer_t target;
dns_result_t result;
isc_region_t r;
dns_name_t empty_name;
char t[1000];
isc_boolean_t first;
dns_name_init(&empty_name, NULL);
printf("\n;; %s SECTION:\n", section_name);
for (name = ISC_LIST_HEAD(*section);
name != NULL;
name = ISC_LIST_NEXT(name, link)) {
isc_buffer_init(&target, t, sizeof t, ISC_BUFFERTYPE_TEXT);
first = ISC_TRUE;
print_name = name;
for (rdatalist = ISC_LIST_HEAD(name->list);
rdatalist != NULL;
rdatalist = ISC_LIST_NEXT(rdatalist, link)) {
......@@ -414,11 +419,17 @@ printsection(dns_namelist_t *section, char *section_name) {
if (result != DNS_R_SUCCESS)
return (result);
result = dns_rdataset_totext(&rdataset, name,
result = dns_rdataset_totext(&rdataset, print_name,
ISC_FALSE, &target);
if (result != DNS_R_SUCCESS)
return (result);
if (first) {
print_name = &empty_name;
first = ISC_FALSE;
isc_buffer_used(&target, &r);
printf("%.*s", (int)r.length, (char *)r.base);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment