summaryrefslogtreecommitdiff
path: root/clients/cli
diff options
context:
space:
mode:
Diffstat (limited to 'clients/cli')
-rw-r--r--clients/cli/connections.c6
-rw-r--r--clients/cli/settings.c12
2 files changed, 13 insertions, 5 deletions
diff --git a/clients/cli/connections.c b/clients/cli/connections.c
index 0e42831c7a..01fd4edf65 100644
--- a/clients/cli/connections.c
+++ b/clients/cli/connections.c
@@ -4694,11 +4694,7 @@ get_value (const char **value, int *argc, char ***argv, const char *option, GErr
return FALSE;
}
- /* Empty string will reset the value to default */
- if (**argv[0] == '\0')
- *value = NULL;
- else
- *value = *argv[0];
+ *value = *argv[0];
(*argc)--;
(*argv)++;
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 '-'.