summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-06-09 15:23:44 +0200
committerThomas Haller <thaller@redhat.com>2017-06-09 15:34:31 +0200
commitee5fdcbfb50ec19b82715440e1c45f3c8e6ee5ea (patch)
treefc3ad096d7c27cdb53460c9a178c9afe79055b09
parent126b0874f19fa3647c0343d73dfdb48d6154bc08 (diff)
downloadNetworkManager-ee5fdcbfb50ec19b82715440e1c45f3c8e6ee5ea.tar.gz
cli: minor refactoring of if-condition in device_overview
Note that nm_device_get_ip_iface() never returns an emptry string "".
-rw-r--r--clients/cli/general.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/clients/cli/general.c b/clients/cli/general.c
index 4179bc9778..b8947cf75d 100644
--- a/clients/cli/general.c
+++ b/clients/cli/general.c
@@ -1194,9 +1194,9 @@ device_overview (NmCli *nmc, NMDevice *device)
else
g_string_append_printf (outbuf, "%s, ", _("hw"));
- if ( nm_device_get_ip_iface (device)
- && g_strcmp0 (nm_device_get_ip_iface (device), nm_device_get_iface (device))
- && g_strcmp0 (nm_device_get_ip_iface (device), ""))
+ if (!NM_IN_STRSET (nm_device_get_ip_iface (device),
+ NULL,
+ nm_device_get_iface (device)))
g_string_append_printf (outbuf, "%s %s, ", _("iface"), nm_device_get_ip_iface (device));
if (nm_device_get_physical_port_id (device))