Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
37928634
Commit
37928634
authored
Mar 01, 2001
by
Andreas Gustafsson
Browse files
don't print extra spaces at omitted optional fields
parent
36b810d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/isccfg/parser.c
View file @
37928634
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: parser.c,v 1.3
4
2001/03/01 03:
10:08
gson Exp $ */
/* $Id: parser.c,v 1.3
5
2001/03/01 03:
22:12
gson Exp $ */
#include
<config.h>
...
...
@@ -275,6 +275,9 @@ get_addr(cfg_parser_t *pctx, unsigned int flags, isc_netaddr_t *na);
static
void
print
(
cfg_printer_t
*
pctx
,
const
char
*
text
,
int
len
);
static
void
print_void
(
cfg_printer_t
*
pctx
,
cfg_obj_t
*
obj
);
static
isc_result_t
parse_mapbody
(
cfg_parser_t
*
pctx
,
cfg_type_t
*
type
,
cfg_obj_t
**
ret
);
...
...
@@ -1113,11 +1116,14 @@ print_tuple(cfg_printer_t *pctx, cfg_obj_t *obj) {
unsigned
int
i
;
cfg_tuplefielddef_t
*
fields
=
obj
->
type
->
of
;
cfg_tuplefielddef_t
*
f
;
isc_boolean_t
need_space
=
ISC_FALSE
;
for
(
f
=
fields
,
i
=
0
;
f
->
name
!=
NULL
;
f
++
,
i
++
)
{
print_obj
(
pctx
,
obj
->
value
.
tuple
[
i
]
)
;
if
(
f
[
1
].
name
!=
NULL
)
cfg_obj_t
*
fieldobj
=
obj
->
value
.
tuple
[
i
];
if
(
need_space
)
print
(
pctx
,
" "
,
1
);
print_obj
(
pctx
,
fieldobj
);
need_space
=
ISC_TF
(
fieldobj
->
type
->
print
!=
print_void
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment