Commit afc25851 authored by Thomas Haller's avatar Thomas Haller

ifcfg-rh: refactor parsing bond options

Don't use g_strsplit_set() if all we want to do is split the
string at the first '='.
parent 78879095
......@@ -4802,16 +4802,16 @@ make_bond_setting (shvarFile *ifcfg,
items = nm_utils_strsplit_set (v, " ");
for (iter = items; iter && *iter; iter++) {
gs_strfreev char **keys = NULL;
const char *key, *val;
keys = g_strsplit_set (*iter, "=", 2);
if (keys && *keys) {
key = *keys;
val = *(keys + 1);
if (val && key[0] && val[0])
handle_bond_option (s_bond, key, val);
}
gs_free char *key = NULL;
const char *val;
val = strchr (*iter, '=');
if (!val)
continue;
key = g_strndup (*iter, val - *iter);
val++;
if (key[0] && val[0])
handle_bond_option (s_bond, key, val);
}
}
......@@ -5082,16 +5082,16 @@ handle_bridging_opts (NMSetting *setting,
items = nm_utils_strsplit_set (value, " ");
for (iter = items; iter && *iter; iter++) {
gs_strfreev char **keys = NULL;
const char *key, *val;
keys = g_strsplit_set (*iter, "=", 2);
if (keys && *keys) {
key = *keys;
val = *(keys + 1);
if (val && key[0] && val[0])
func (setting, stp, key, val, opt_type);
}
gs_free char *key = NULL;
const char *val;
val = strchr (*iter, '=');
if (!val)
continue;
key = g_strndup (*iter, val - *iter);
val++;
if (key[0] && val[0])
func (setting, stp, key, val, opt_type);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment