BUGFIX resolving leafref paths
Resolve leafrefs starting from the type's leaf(list) node, not
the leaf(list)'s parent as it was mistakenly adopted from the case
when the type is used in typedef.
Fixes #78
diff --git a/src/parser_yin.c b/src/parser_yin.c
index 44d3078..0eeb2ac 100644
--- a/src/parser_yin.c
+++ b/src/parser_yin.c
@@ -3022,7 +3022,7 @@
/* HACK for unres */
leaf->type.der = (struct lys_tpdf *)sub;
leaf->type.parent = (struct lys_tpdf *)leaf;
- if (unres_schema_add_node(module, unres, &leaf->type, UNRES_TYPE_DER, parent)) {
+ if (unres_schema_add_node(module, unres, &leaf->type, UNRES_TYPE_DER, retval)) {
leaf->type.der = NULL;
goto error;
}
@@ -3194,7 +3194,7 @@
/* HACK for unres */
llist->type.der = (struct lys_tpdf *)sub;
llist->type.parent = (struct lys_tpdf *)llist;
- if (unres_schema_add_node(module, unres, &llist->type, UNRES_TYPE_DER, parent)) {
+ if (unres_schema_add_node(module, unres, &llist->type, UNRES_TYPE_DER, retval)) {
llist->type.der = NULL;
goto error;
}