context BUGFIX ctx set options inval arg
Forbid only enabling NO_YANGLIB flag,
it is fine if it was set before.
diff --git a/src/context.c b/src/context.c
index 409857a..99f57fa 100644
--- a/src/context.c
+++ b/src/context.c
@@ -542,7 +542,8 @@
uint32_t i;
LY_CHECK_ARG_RET(ctx, ctx, LY_EINVAL);
- LY_CHECK_ERR_RET(option & LY_CTX_NO_YANGLIBRARY, LOGARG(ctx, option), LY_EINVAL);
+ LY_CHECK_ERR_RET((option & LY_CTX_NO_YANGLIBRARY) && !(ctx->flags & LY_CTX_NO_YANGLIBRARY),
+ LOGARG(ctx, option), LY_EINVAL);
if (!(ctx->flags & LY_CTX_SET_PRIV_PARSED) && (option & LY_CTX_SET_PRIV_PARSED)) {
ctx->flags |= LY_CTX_SET_PRIV_PARSED;