aboutsummaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'common.c')
-rw-r--r--common.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/common.c b/common.c
index 6210011..6320afd 100644
--- a/common.c
+++ b/common.c
@@ -550,11 +550,10 @@ struct config_schema
const char *comment; ///< User-readable description
enum config_item_type type; ///< Required type
- bool is_nullable; ///< Can be null?
const char *default_; ///< Default as a configuration snippet
/// Check if the new value can be accepted.
- /// If this is not defined, only "type" and "is_nullable" is considered.
+ /// If this is not defined, only "type" and having a default is considered.
bool (*validate) (struct config_item_ *, const struct config_item_ *);
/// The value has changed. Only appliable to objects.
@@ -696,7 +695,7 @@ config_schema_accepts_type
if (config_item_type_is_string (self->type)
&& config_item_type_is_string (type))
return true;
- return self->is_nullable && type == CONFIG_ITEM_NULL;
+ return !self->default_ && type == CONFIG_ITEM_NULL;
}
@@ -717,7 +716,7 @@ config_item_set_from (struct config_item_ *self, struct config_item_ *source,
{
error_set (e, "invalid type of value, expected: %s%s",
config_item_type_name (schema->type),
- schema->is_nullable ? " (or null)" : "");
+ !schema->default_ ? " (or null)" : "");
return false;
}