diff options
| author | Michael Biebl <biebl@debian.org> | 2018-06-17 14:54:10 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2018-06-17 14:54:10 +0200 |
| commit | 069cb5c3a525ebcc19cc2927964258acaca87b13 (patch) | |
| tree | 66ac6b21a44d630c0fc281c0df327239d491226a /clients/cli/common.c | |
| parent | 04bc9e1cd3544445d883ad29ea108c1645c8e7b7 (diff) | |
New upstream version 1.11.90 upstream/1.11.90
Diffstat (limited to 'clients/cli/common.c')
| -rw-r--r-- | clients/cli/common.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/clients/cli/common.c b/clients/cli/common.c index e566de47..09c86334 100644 --- a/clients/cli/common.c +++ b/clients/cli/common.c @@ -49,6 +49,9 @@ _ip_config_get_routes (NMIPConfig *cfg) if (!ptr_array) return NULL; + if (ptr_array->len == 0) + return NULL; + arr = g_new (char *, ptr_array->len + 1); for (i = 0; i < ptr_array->len; i++) { NMIPRoute *route = g_ptr_array_index (ptr_array, i); @@ -384,7 +387,7 @@ print_dhcp_config (NMDhcpConfig *dhcp, /* * nmc_find_connection: * @connections: array of NMConnections to search in - * @filter_type: "id", "uuid", "path" or %NULL + * @filter_type: "id", "uuid", "path", "filename", or %NULL * @filter_val: connection to find (connection name, UUID or path) * @out_result: if not NULL, attach all matching connection to this * list. If necessary, a new array will be allocated. If the array @@ -452,6 +455,14 @@ nmc_find_connection (const GPtrArray *connections, goto found; } + if (NM_IN_STRSET (filter_type, NULL, "filename")) { + v = nm_remote_connection_get_filename (NM_REMOTE_CONNECTION (connections->pdata[i])); + if (complete && (filter_type || *filter_val)) + nmc_complete_strings (filter_val, v, NULL); + if (nm_streq0 (filter_val, v)) + goto found; + } + continue; found: if (!out_result) @@ -523,6 +534,14 @@ nmc_find_active_connection (const GPtrArray *active_cons, goto found; } + if (NM_IN_STRSET (filter_type, NULL, "filename")) { + v = nm_remote_connection_get_filename (con); + if (complete && (filter_type || *filter_val)) + nmc_complete_strings (filter_val, v, NULL); + if (nm_streq0 (filter_val, v)) + goto found; + } + if (NM_IN_STRSET (filter_type, NULL, "apath")) { v = nm_object_get_path (NM_OBJECT (candidate)); v_num = nm_utils_dbus_path_get_last_component (v); |