summaryrefslogtreecommitdiff
path: root/clients
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2016-08-02 17:11:50 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2016-08-02 17:21:12 +0200
commit482e506674f4b48e96c43008beea2374cb24cf8c (patch)
tree929b30a0975d90f6af7afaf242eebc04815a9e12 /clients
parentec6a118f292eb6262773780134d4e6e19e074e50 (diff)
downloadNetworkManager-482e506674f4b48e96c43008beea2374cb24cf8c.tar.gz
cli: fix error reporting for connection delete
get_connection() shifts to the next argument, so we need to cache the old one. Fixes: 717db4fe014ecc80eb8bb86757f724448116a662
Diffstat (limited to 'clients')
-rw-r--r--clients/cli/connections.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/clients/cli/connections.c b/clients/cli/connections.c
index e5dcab919d..7888523eda 100644
--- a/clients/cli/connections.c
+++ b/clients/cli/connections.c
@@ -8145,7 +8145,7 @@ do_connection_delete (NmCli *nmc, int argc, char **argv)
NMConnection *connection;
ConnectionCbInfo *info = NULL;
GSList *queue = NULL, *iter;
- char **arg_arr = NULL;
+ char **arg_arr = NULL, *old_arg;
char **arg_ptr = argv;
int arg_num = argc;
GString *invalid_cons = NULL;
@@ -8175,6 +8175,7 @@ do_connection_delete (NmCli *nmc, int argc, char **argv)
}
while (arg_num > 0) {
+ old_arg = *arg_ptr;
connection = get_connection (nmc, &arg_num, &arg_ptr, &pos, &error);
if (connection) {
/* Check if the connection is unique. */
@@ -8194,7 +8195,7 @@ do_connection_delete (NmCli *nmc, int argc, char **argv)
if (!invalid_cons)
invalid_cons = g_string_new (NULL);
- g_string_append_printf (invalid_cons, "'%s', ", *arg_ptr);
+ g_string_append_printf (invalid_cons, "'%s', ", old_arg);
}
}