parser data UPDATE parse_store_only flag sets parse_only as well
... because it extends the functionality of the
other flag and allow to test for only the latter
flag internally.
diff --git a/src/parser_common.c b/src/parser_common.c
index 06544f1..8b46db0 100644
--- a/src/parser_common.c
+++ b/src/parser_common.c
@@ -284,7 +284,7 @@
{
LY_ERR r;
ly_bool incomplete;
- ly_bool store_only = (lydctx->parse_opts & LYD_PARSE_STORE_ONLY) ? 1 : 0;
+ ly_bool store_only = (lydctx->parse_opts & LYD_PARSE_STORE_ONLY) == LYD_PARSE_STORE_ONLY ? 1 : 0;
if ((r = lyd_create_term(schema, value, value_len, 1, store_only, dynamic, format, prefix_data,
hints, &incomplete, node))) {
@@ -310,7 +310,7 @@
char *dpath = NULL, *path = NULL;
ly_bool incomplete;
struct lyd_meta *first = NULL;
- ly_bool store_only = (lydctx->parse_opts & LYD_PARSE_STORE_ONLY) ? 1 : 0;
+ ly_bool store_only = (lydctx->parse_opts & LYD_PARSE_STORE_ONLY) == LYD_PARSE_STORE_ONLY ? 1 : 0;
if (meta && *meta) {
/* remember the first metadata */
diff --git a/src/parser_data.h b/src/parser_data.h
index e1a6d11..d13fd57 100644
--- a/src/parser_data.h
+++ b/src/parser_data.h
@@ -172,7 +172,7 @@
#define LYD_PARSE_NO_NEW 0x1000000 /**< Do not set ::LYD_NEW (non-validated node flag) for any nodes. Use
when parsing validated data to skip some validation tasks and modify
some validation behavior (auto-deletion of cases). */
-#define LYD_PARSE_STORE_ONLY 0x2000000 /**< Similar to ::LYD_PARSE_ONLY but even type value restrictions will not
+#define LYD_PARSE_STORE_ONLY 0x2010000 /**< Similar to ::LYD_PARSE_ONLY but even type value restrictions will not
be checked (length, range, pattern, ...) and if a value can be stored,
it is. Calling separate validation on these data always checks all the
restrictions as well. */