From 51d5b97bd7878543674a3531fa646587d9a7bf07 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Mon, 4 Dec 2017 10:30:29 +0100 Subject: [PATCH] libnm-core/utils: allow using the same character for key/value and attribute separators Allows doing a nm_utils_parse_variant_attributes(..., ' ', ' '). (cherry picked from commit 48a619e62b5521f512792019b6a74dfdaf6c4a88) --- libnm-core/nm-utils.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c index 1eb56e10cf..568422011e 100644 --- a/libnm-core/nm-utils.c +++ b/libnm-core/nm-utils.c @@ -5483,6 +5483,10 @@ nm_utils_parse_variant_attributes (const char *string, return NULL; } + /* The attribute and key/value separators are the same. Look for the next one. */ + if (ptr == sep) + goto next; + name = attribute_unescape (start, sep); value = attribute_unescape (sep + 1, ptr);