aboutsummaryrefslogtreecommitdiffstats
path: root/tethereal.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2002-06-27 22:39:16 +0000
committerGerald Combs <gerald@wireshark.org>2002-06-27 22:39:16 +0000
commit83dc23831a86172318115027725328c34e5a1908 (patch)
tree90c491f1d8e926ce4d24eff770454df4226ba9b7 /tethereal.c
parentc2df675f3f0d43ed924ca61454651c22c3fc0bc1 (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. svn path=/trunk/; revision=5770
Diffstat (limited to 'tethereal.c')
-rw-r--r--tethereal.c18
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);
}
}