From 83dc23831a86172318115027725328c34e5a1908 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Thu, 27 Jun 2002 22:39:16 +0000 Subject: Update tethereal to handle the " : " interface names that are generated under Windows. Note in pcap-util.c that we may want to separate interface device names and descriptions in the future. svn path=/trunk/; revision=5770 --- tethereal.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'tethereal.c') diff --git a/tethereal.c b/tethereal.c index 198459cda9..249fa04014 100644 --- a/tethereal.c +++ b/tethereal.c @@ -1,6 +1,6 @@ /* tethereal.c * - * $Id: tethereal.c,v 1.143 2002/06/23 21:58:02 guy Exp $ + * $Id: tethereal.c,v 1.144 2002/06/27 22:39:16 gerald Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -320,7 +320,7 @@ main(int argc, char *argv[]) gboolean capture_option_specified = FALSE; #endif int out_file_type = WTAP_FILE_PCAP; - gchar *cf_name = NULL, *rfilter = NULL; + gchar *cf_name = NULL, *rfilter = NULL, *if_text; dfilter_t *rfcode = NULL; e_prefs *prefs; char badopt; @@ -818,7 +818,12 @@ main(int argc, char *argv[]) /* No - is a default specified in the preferences file? */ if (prefs->capture_device != NULL) { /* Yes - use it. */ - cfile.iface = g_strdup(prefs->capture_device); + if_text = strrchr(prefs->capture_device, ' '); + if (if_text == NULL) { + cfile.iface = g_strdup(prefs->capture_device); + } else { + cfile.iface = g_strdup(if_text + 1); /* Skip over space */ + } } else { /* No - pick the first one from the list of interfaces. */ if_list = get_interface_list(&err, err_str); @@ -836,7 +841,12 @@ main(int argc, char *argv[]) } exit(2); } - cfile.iface = g_strdup(if_list->data); /* first interface */ + if_text = strrchr(if_list->data, ' '); /* first interface */ + if (if_text == NULL) { + cfile.iface = g_strdup(if_list->data); + } else { + cfile.iface = g_strdup(if_text + 1); /* Skip over space */ + } free_interface_list(if_list); } } -- cgit v1.2.3