From 4599be093e97d032b0a888c7deeeb84343a9005b Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Tue, 7 Jul 2020 18:07:43 +0200 Subject: [PATCH] libnm-core: don't print value for no-value attributes --- shared/nm-glib-aux/nm-shared-utils.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/shared/nm-glib-aux/nm-shared-utils.c b/shared/nm-glib-aux/nm-shared-utils.c index e6be79649f..9479e64934 100644 --- a/shared/nm-glib-aux/nm-shared-utils.c +++ b/shared/nm-glib-aux/nm-shared-utils.c @@ -5075,11 +5075,13 @@ _nm_utils_format_variant_attributes_full (GString *str, g_string_append (str, escaped); g_free (escaped); - g_string_append_c (str, key_value_separator); + if (!s || !*s || !(*s)->no_value) { + g_string_append_c (str, key_value_separator); - escaped = attribute_escape (value, attr_separator, key_value_separator); - g_string_append (str, escaped); - g_free (escaped); + escaped = attribute_escape (value, attr_separator, key_value_separator); + g_string_append (str, escaped); + g_free (escaped); + } sep = attr_separator; }