I looked in the library and after a small intervention it looks better, I can also read the value from a document containing only one scalar (path /):
--- src/lib/fy-doc.c.orig 2022-06-11 19:57:44.000000000 +0100
+++ src/lib/fy-doc.c 2022-06-12 07:51:53.000000000 +0100
@@ -4070,9 +4070,10 @@
__func__, __LINE__, fy_node_get_path(fyn), (int)(e - s), s); */
fyn = fy_node_follow_aliases(fyn, flags, true);
- /* scalar can't match (it has no key) */
+ /* scalar can be only last element in the path (it has no key) */
if (fy_node_is_scalar(fyn)) {
- fyn = NULL;
+ if (*s)
+ fyn = NULL; /* not end of the path - fail */
goto out;
}
I tried using the
fy_document_scanf()
function to read a scalar value from an array and it looks like it doesn't work? This test code:I looked in the library and after a small intervention it looks better, I can also read the value from a document containing only one scalar (path /):
Please, is there a documented search path format?