From a3c0a79b61edfd6a021c080d4b368c9c962fcad6 Mon Sep 17 00:00:00 2001 From: Andreas Gustafsson Date: Fri, 2 Jun 2000 00:14:02 +0000 Subject: [PATCH] dns_name_totext() now always prints the root name as '.', even when omit_final_dot is true --- CHANGES | 3 +++ lib/dns/include/dns/name.h | 5 ++--- lib/dns/name.c | 6 +----- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index 5c75b395e8..956273ab89 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ + 226. [func] dns_name_totext() now always prints the root name as '.', + even when omit_final_dot is true. + 225. [cleanup] The enumerated dns_rdatatype_* identifiers are now cast to dns_rdatatype_t via macros of their same name so that they are of the proper integral type wherever diff --git a/lib/dns/include/dns/name.h b/lib/dns/include/dns/name.h index 3761aa86a0..d1d3abf1b3 100644 --- a/lib/dns/include/dns/name.h +++ b/lib/dns/include/dns/name.h @@ -845,9 +845,8 @@ dns_name_totext(dns_name_t *name, isc_boolean_t omit_final_dot, /* * Convert 'name' into text format, storing the result in 'target'. * - * Notes: - * If 'omit_final_dot' is true, then the final '.' in an absolute - * name will not be emitted. + * If 'omit_final_dot' is true, then the final '.' in absolute + * names other than the root name will be omitted. * * Requires: * diff --git a/lib/dns/name.c b/lib/dns/name.c index 8aa8744c6b..9490d38457 100644 --- a/lib/dns/name.c +++ b/lib/dns/name.c @@ -3056,18 +3056,14 @@ void dns_name_format(dns_name_t *name, char *cp, unsigned int size) { isc_result_t result; isc_buffer_t buf; - isc_boolean_t omit_final_dot = ISC_TRUE; REQUIRE(size > 0); - if (dns_name_equal(name, dns_rootname)) - omit_final_dot = ISC_FALSE; - /* * Leave room for null termination after buffer. */ isc_buffer_init(&buf, cp, size - 1); - result = dns_name_totext(name, omit_final_dot, &buf); + result = dns_name_totext(name, ISC_TRUE, &buf); if (result == ISC_R_SUCCESS) { /* * Null terminate.