]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
add brackets for multi-line output
authorMark Andrews <marka@isc.org>
Thu, 28 Feb 2019 04:39:37 +0000 (15:39 +1100)
committerMark Andrews <marka@isc.org>
Thu, 21 Mar 2019 09:26:52 +0000 (20:26 +1100)
(cherry picked from commit 40a770b9329b2b00ab0e5d9011a0bad43f4e7886)

lib/dns/rdata/in_1/eid_31.c
lib/dns/rdata/in_1/nimloc_32.c

index 9768d383a6e187c5035f579dc3967e6c0cbfa7ec..e22ac4ae7abb2707961802aaff0c8356c14083d3 100644 (file)
@@ -41,12 +41,19 @@ totext_in_eid(ARGS_TOTEXT) {
 
        dns_rdata_toregion(rdata, &region);
 
+       if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) {
+               RETERR(str_totext("( ", target));
+       }
        if (tctx->width == 0) {
-               return (isc_hex_totext(&region, 60, "", target));
+               RETERR(isc_hex_totext(&region, 60, "", target));
        } else {
-               return (isc_hex_totext(&region, tctx->width - 2,
-                                      tctx->linebreak, target));
+               RETERR(isc_hex_totext(&region, tctx->width - 2,
+                                     tctx->linebreak, target));
+       }
+       if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) {
+               RETERR(str_totext(" )", target));
        }
+       return (ISC_R_SUCCESS);
 }
 
 static inline isc_result_t
index bf7429232b7fc97d42349d581ad8bfbb8c3aef43..1070a4e8c0bfe49daa3d22faa7c99d0fc814423b 100644 (file)
@@ -41,12 +41,19 @@ totext_in_nimloc(ARGS_TOTEXT) {
 
        dns_rdata_toregion(rdata, &region);
 
+       if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) {
+               RETERR(str_totext("( ", target));
+       }
        if (tctx->width == 0) {
-               return (isc_hex_totext(&region, 60, "", target));
+               RETERR(isc_hex_totext(&region, 60, "", target));
        } else {
-               return (isc_hex_totext(&region, tctx->width - 2,
-                                      tctx->linebreak, target));
+               RETERR(isc_hex_totext(&region, tctx->width - 2,
+                                     tctx->linebreak, target));
+       }
+       if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) {
+               RETERR(str_totext(" )", target));
        }
+       return (ISC_R_SUCCESS);
 }
 
 static inline isc_result_t