From 53b3e3d709c9b9754890aff4d79fb212c6f04d0a Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 17 Apr 2019 17:13:20 +0200 Subject: [PATCH] cli: return early when splitting with %VALUE_STRSPLIT_MODE_STRIPPED The reminder of the function only does (something akin to) g_strstrip(). As we split the strings are spaces to begin with, there is nothing to strip and we can return right away. (cherry picked from commit b74d9a0bd5703f499c9bd432e85b89eb3f455cb7) --- clients/common/nm-meta-setting-desc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c index 9260f6eff5..65737d8032 100644 --- a/clients/common/nm-meta-setting-desc.c +++ b/clients/common/nm-meta-setting-desc.c @@ -201,7 +201,8 @@ _value_strsplit (const char *value, switch (split_mode) { case VALUE_STRSPLIT_MODE_STRIPPED: strv = nm_utils_strsplit_set (value, NM_ASCII_SPACES","); - break; + NM_SET_OUT (out_len, NM_PTRARRAY_LEN (strv)); + return g_steal_pointer (&strv); case VALUE_STRSPLIT_MODE_OBJLIST: strv = nm_utils_strsplit_set (value, ","); break;