Skip to content

Commit a06c5d3

Browse files
committed
printer context BUGFIX print (leaf-)list units
Fixes #2473
1 parent 22785f9 commit a06c5d3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/printer_context.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,6 +1373,9 @@ ctxp_node(const struct lysc_node *orig_node, struct lysc_node *node, struct ly_h
13731373
/* type */
13741374
ctxp_type(orig_leaf->type, &leaf->type, addr_ht, ptr_set, mem);
13751375

1376+
/* units */
1377+
leaf->units = ly_ctx_compiled_addr_ht_get(addr_ht, orig_leaf->units, 0);
1378+
13761379
/* dflt */
13771380
ctxp_dflt(&orig_leaf->dflt, &leaf->dflt, addr_ht, ptr_set, mem);
13781381
break;
@@ -1395,6 +1398,9 @@ ctxp_node(const struct lysc_node *orig_node, struct lysc_node *node, struct ly_h
13951398
/* type */
13961399
ctxp_type(orig_llist->type, &llist->type, addr_ht, ptr_set, mem);
13971400

1401+
/* units */
1402+
llist->units = ly_ctx_compiled_addr_ht_get(addr_ht, orig_llist->units, 0);
1403+
13981404
/* dflts */
13991405
CTXP_SIZED_ARRAY(orig_llist->dflts, llist->dflts, mem);
14001406
LY_ARRAY_FOR(orig_llist->dflts, u) {

0 commit comments

Comments
 (0)