mirror of
https://github.com/isc-projects/bind9.git
synced 2026-03-09 09:40:45 -04:00
don't print parens at all if in non-multiline mode.
This commit is contained in:
parent
75e1e12f48
commit
9ce72fc748
1 changed files with 13 additions and 8 deletions
|
|
@ -15,7 +15,7 @@
|
|||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: soa_6.c,v 1.42 2000/08/01 01:26:02 tale Exp $ */
|
||||
/* $Id: soa_6.c,v 1.43 2000/08/22 22:07:13 bwelling Exp $ */
|
||||
|
||||
/* Reviewed: Thu Mar 16 15:18:32 PST 2000 by explorer */
|
||||
|
||||
|
|
@ -73,9 +73,15 @@ totext_soa(ARGS_TOTEXT) {
|
|||
dns_name_t prefix;
|
||||
isc_boolean_t sub;
|
||||
int i;
|
||||
isc_boolean_t multiline;
|
||||
|
||||
REQUIRE(rdata->type == 6);
|
||||
|
||||
multiline = ISC_TF((tctx->flags & (DNS_STYLEFLAG_MULTILINE |
|
||||
DNS_STYLEFLAG_COMMENT)) ==
|
||||
(DNS_STYLEFLAG_MULTILINE |
|
||||
DNS_STYLEFLAG_COMMENT));
|
||||
|
||||
dns_name_init(&mname, NULL);
|
||||
dns_name_init(&rname, NULL);
|
||||
dns_name_init(&prefix, NULL);
|
||||
|
|
@ -96,7 +102,8 @@ totext_soa(ARGS_TOTEXT) {
|
|||
sub = name_prefix(&rname, tctx->origin, &prefix);
|
||||
RETERR(dns_name_totext(&prefix, sub, target));
|
||||
|
||||
RETERR(str_totext(" (" , target));
|
||||
if (multiline)
|
||||
RETERR(str_totext(" (" , target));
|
||||
RETERR(str_totext(tctx->linebreak, target));
|
||||
|
||||
for (i = 0; i < 5 ; i++) {
|
||||
|
|
@ -108,10 +115,7 @@ totext_soa(ARGS_TOTEXT) {
|
|||
numlen = sprintf(buf, "%lu", num);
|
||||
INSIST(numlen > 0 && numlen < sizeof "2147483647");
|
||||
RETERR(str_totext(buf, target));
|
||||
if ((tctx->flags & (DNS_STYLEFLAG_MULTILINE |
|
||||
DNS_STYLEFLAG_COMMENT)) ==
|
||||
(DNS_STYLEFLAG_MULTILINE |
|
||||
DNS_STYLEFLAG_COMMENT)) {
|
||||
if (multiline) {
|
||||
RETERR(str_totext(" ; " + numlen, target));
|
||||
RETERR(str_totext(soa_fieldnames[i], target));
|
||||
/* Print times in week/day/hour/minute/second form */
|
||||
|
|
@ -121,12 +125,13 @@ totext_soa(ARGS_TOTEXT) {
|
|||
RETERR(str_totext(")", target));
|
||||
}
|
||||
RETERR(str_totext(tctx->linebreak, target));
|
||||
} else {
|
||||
} else if (i < 4) {
|
||||
RETERR(str_totext(" ", target));
|
||||
}
|
||||
}
|
||||
|
||||
RETERR(str_totext(")", target));
|
||||
if (multiline)
|
||||
RETERR(str_totext(" )", target));
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue