]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorAndreas Gustafsson <source@isc.org>
Fri, 20 Oct 2000 21:44:09 +0000 (21:44 +0000)
committerAndreas Gustafsson <source@isc.org>
Fri, 20 Oct 2000 21:44:09 +0000 (21:44 +0000)
Fix overzealous printing of newlines in message_[pseudo]sectiontotext().

lib/dns/message.c

index 8f7ba8cbc99f21bc51ab19d44f2a22d816812bc6..297df4ee8ee9de230e6d7402c578469fdc4ab3c3 100644 (file)
@@ -15,7 +15,7 @@
  * SOFTWARE.
  */
 
-/* $Id: message.c,v 1.131.2.9 2000/10/12 00:14:42 mws Exp $ */
+/* $Id: message.c,v 1.131.2.10 2000/10/20 21:44:09 gson Exp $ */
 
 /***
  *** Imports
@@ -2745,7 +2745,8 @@ dns_message_sectiontotext(dns_message_t *msg, dns_section_t section,
                }
                result = dns_message_nextname(msg, section);
        } while (result == ISC_R_SUCCESS);
-       if ((flags & DNS_MESSAGETEXTFLAG_NOHEADERS) == 0)
+       if ((flags & DNS_MESSAGETEXTFLAG_NOHEADERS) == 0 &&
+           (flags & DNS_MESSAGETEXTFLAG_NOCOMMENTS) == 0)
                ADD_STRING(target, "\n");
        if (result == ISC_R_NOMORE)
                result = ISC_R_SUCCESS;
@@ -2794,7 +2795,9 @@ dns_message_pseudosectiontotext(dns_message_t *msg,
                        ADD_STRING(target, ";; TSIG PSEUDOSECTION:\n");
                result = dns_rdataset_totext(ps, name, omit_final_dot,
                                             ISC_FALSE, target);
-               ADD_STRING(target, "\n");
+               if ((flags & DNS_MESSAGETEXTFLAG_NOHEADERS) == 0 &&
+                   (flags & DNS_MESSAGETEXTFLAG_NOCOMMENTS) == 0)
+                       ADD_STRING(target, "\n");
                return (result);
        case DNS_PSEUDOSECTION_SIG0:
                ps = dns_message_getsig0(msg, &name);
@@ -2804,7 +2807,8 @@ dns_message_pseudosectiontotext(dns_message_t *msg,
                        ADD_STRING(target, ";; SIG0 PSEUDOSECTION:\n");
                result = dns_rdataset_totext(ps, name, omit_final_dot,
                                             ISC_FALSE, target);
-               if ((flags & DNS_MESSAGETEXTFLAG_NOHEADERS) == 0)
+               if ((flags & DNS_MESSAGETEXTFLAG_NOHEADERS) == 0 &&
+                   (flags & DNS_MESSAGETEXTFLAG_NOCOMMENTS) == 0)
                        ADD_STRING(target, "\n");
                return (result);
        }