schema BUGFIX allow do not touch features settings
With LY_CTX_ALL_IMPLEMENTED flag, even the imported modules became
implemented and its features were set (disabled). But when importing modules,
we don't want to set the features (we don't know how). It is because it is done
by a common code shared with other functions where the caller is able to set
the features setting and we want to follow his willing. Therefore, we need a
way to say "do not touch the features". In newly implemented module it means
that all features are disabled, for already implemented modules the
features setttings do not change.
This "do not touch" way is available not only internally when importing
module, but it was also propagated to the API functions.
Fixes #1355
diff --git a/src/schema_features.c b/src/schema_features.c
index bbcfa6f..253da6b 100644
--- a/src/schema_features.c
+++ b/src/schema_features.c
@@ -560,6 +560,9 @@
ly_bool change = 0;
if (!features) {
+ /* do not touch the features */
+
+ } else if (!features[0]) {
/* disable all the features */
while ((f = lysp_feature_next(f, pmod, &i))) {
if (f->flags & LYS_FENABLED) {