Skip to content

Commit 43f7dc5

Browse files
committed
tree printer BUGFIX set special config in subtree
Fixes #1597
1 parent 7e2a3b1 commit 43f7dc5

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/printer_tree.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -690,11 +690,6 @@ tree_print_snode(struct lyout *out, int level, uint16_t max_name_len, const stru
690690
/* this node is finished printing */
691691
ly_print(out, "\n");
692692

693-
if ((subtree == 1) || ((node->nodetype & mask) == LYS_USES)) {
694-
/* we are printing subtree parents, finish here (or uses option) */
695-
return;
696-
}
697-
698693
/* set special config flag */
699694
switch (node->nodetype & mask) {
700695
case LYS_INPUT:
@@ -704,10 +699,18 @@ tree_print_snode(struct lyout *out, int level, uint16_t max_name_len, const stru
704699
case LYS_NOTIF:
705700
opts->spec_config = 2;
706701
break;
702+
case LYS_USES:
703+
/* nothing more to print */
704+
return;
707705
default:
708706
break;
709707
}
710708

709+
if (subtree == 1) {
710+
/* we are printing subtree parents, finish here */
711+
return;
712+
}
713+
711714
print_children:
712715
/* set child mask and learn the longest child name (needed only if a child can have type) */
713716
switch (node->nodetype & mask) {

0 commit comments

Comments
 (0)