diff options
author | gerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7> | 2002-06-27 22:39:16 +0000 |
---|---|---|
committer | gerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7> | 2002-06-27 22:39:16 +0000 |
commit | 727123542d8e77e1dfcde81550e1e3262e42caab (patch) | |
tree | 90c491f1d8e926ce4d24eff770454df4226ba9b7 /tethereal.c | |
parent | 8fc7dfe8318c026c5ac7eab7e64e5e92cc96f659 (diff) |
Update tethereal to handle the "<description> : <device ID>" 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.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5770 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'tethereal.c')
-rw-r--r-- | tethereal.c | 18 |
1 files changed, 14 insertions, 4 deletions
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 <gerald@ethereal.com> @@ -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); } } |