From ebaee3a3884c57681bc65bd876e5132f908cb404 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 20 Jun 2008 15:08:09 +0000 Subject: [PATCH] Fix duplicate Default printouts git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3760 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- test/nm-tool.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/nm-tool.c b/test/nm-tool.c index e6d3df7212..d389a12ede 100644 --- a/test/nm-tool.c +++ b/test/nm-tool.c @@ -206,6 +206,7 @@ detail_device (gpointer data, gpointer user_data) const GArray *array; const GPtrArray *connections; int j; + gboolean is_default = FALSE; state = nm_device_get_state (device); @@ -237,11 +238,14 @@ detail_device (gpointer data, gpointer user_data) candidate_dev = g_ptr_array_index (devices, 0); if ((candidate_dev == device) && nm_active_connection_get_default(candidate)) - print_string ("Default", "yes"); - else - print_string ("Default", "no"); + is_default = TRUE; } + if (is_default) + print_string ("Default", "yes"); + else + print_string ("Default", "no"); + tmp = NULL; if (NM_IS_DEVICE_ETHERNET (device)) tmp = g_strdup (nm_device_ethernet_get_hw_address (NM_DEVICE_ETHERNET (device)));