diff options
Diffstat (limited to 'clients/cli/settings.c')
-rw-r--r-- | clients/cli/settings.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clients/cli/settings.c b/clients/cli/settings.c index fec36a89fd..74b642b0ad 100644 --- a/clients/cli/settings.c +++ b/clients/cli/settings.c @@ -549,6 +549,18 @@ nmc_setting_set_property (NMClient *client, if (!property_info->property_type->set_fcn) goto out_fail_read_only; + if (property_info->del_sets_null) { + /* Attempting to delete this property sets it to NULL */ + if (modifier == NM_META_ACCESSOR_MODIFIER_DEL) { + modifier = NM_META_ACCESSOR_MODIFIER_SET; + value = NULL; + } + } else if (!value && value[0] == '\0') { + /* Empty string will reset the value to default */ + value = NULL; + } + + if ( modifier == NM_META_ACCESSOR_MODIFIER_DEL && !property_info->property_type->set_supports_remove) { /* The property is a plain property. It does not support '-'. |