More comments.

Change-Id: I1fc6df514983bb73b7e620d05223728496de7919
Reviewed-on: https://code.wireshark.org/review/29078
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2018-08-11 13:40:00 -07:00
parent 1b3aaeae72
commit 530061b66e
1 changed files with 15 additions and 1 deletions

View File

@ -591,12 +591,26 @@ get_iface_list_string(capture_options *capture_opts, guint32 style)
gchar *
get_iface_display_name(const gchar *description, const if_info_t *if_info)
{
/* Do we have a user-supplied description? */
if (description && description[0]) {
/* We have a user-supplied description. */
/*
* Yes - show both the user-supplied description and a name for the
* interface.
*/
#ifdef _WIN32
/*
* On Windows, if we have a friendly name, just show it
* rather than the name, as the name is a string made out
* of the device GUID, and not at all friendly.
*/
gchar *if_string = if_info->friendly_name ? if_info->friendly_name : if_info->name;
return g_strdup_printf("%s: %s", description, if_string);
#else
/*
* On UN*X, show the interface name; it's short and somewhat
* friendly, and many UN*X users are used to interface names,
* so we should show it.
*/
return g_strdup_printf("%s: %s", description, if_info->name);
#endif
}