mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-04 02:50:17 +01:00
config: backport refactoring to no_auto_default_merge_from_file()
The original backport was different then what was done on master. Make 'nm-config.c' more similar to what we have on master. Fixes:d510f0a039(cherry picked from commit643f042b9b)
This commit is contained in:
parent
b2a6022de8
commit
53dcdf8516
1 changed files with 10 additions and 10 deletions
|
|
@ -244,18 +244,18 @@ no_auto_default_merge_from_file (const char *no_auto_default_file, const char *c
|
|||
&& g_file_get_contents (no_auto_default_file, &data, NULL, NULL)) {
|
||||
list = g_strsplit (data, "\n", -1);
|
||||
for (i = 0; list[i]; i++) {
|
||||
if (!*list[i]) {
|
||||
if (!*list[i])
|
||||
g_free (list[i]);
|
||||
continue;
|
||||
else {
|
||||
for (j = 0; j < updated->len; j++) {
|
||||
if (!strcmp (list[i], updated->pdata[j]))
|
||||
break;
|
||||
}
|
||||
if (j == updated->len)
|
||||
g_ptr_array_add (updated, list[i]);
|
||||
else
|
||||
g_free (list[i]);
|
||||
}
|
||||
for (j = 0; j < updated->len; j++) {
|
||||
if (!strcmp (list[i], updated->pdata[j]))
|
||||
break;
|
||||
}
|
||||
if (j == updated->len)
|
||||
g_ptr_array_add (updated, list[i]);
|
||||
else
|
||||
g_free (list[i]);
|
||||
}
|
||||
g_free (list);
|
||||
g_free (data);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue