aboutsummaryrefslogtreecommitdiffstats
path: root/tshark.c
diff options
context:
space:
mode:
authortuexen <tuexen@f5534014-38df-0310-8fa8-9805f1628bb7>2011-05-18 18:35:57 +0000
committertuexen <tuexen@f5534014-38df-0310-8fa8-9805f1628bb7>2011-05-18 18:35:57 +0000
commit04b00e11e4f427149eea21f5e2d217781c396e88 (patch)
tree7a02f4dbf527f70b1677825d6c09e55da74dbbce /tshark.c
parentd4390f72aefb93c579e38ec2250083ee97ebe680 (diff)
Don't print too many interface names...
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37253 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/tshark.c b/tshark.c
index 8572096561..1b49ec8331 100644
--- a/tshark.c
+++ b/tshark.c
@@ -2055,16 +2055,29 @@ capture(void)
interface_opts.descr = get_interface_descriptive_name(interface_opts.name);
global_capture_opts.ifaces = g_array_remove_index(global_capture_opts.ifaces, i);
g_array_insert_val(global_capture_opts.ifaces, i, interface_opts);
- if (i > 0) {
- if (global_capture_opts.ifaces->len > 2) {
- g_string_append_printf(str, ",");
- }
- g_string_append_printf(str, " ");
- if (i == global_capture_opts.ifaces->len - 1) {
- g_string_append_printf(str, "and ");
- }
+ }
+#ifdef _WIN32
+ if (global_capture_opts.ifaces->len < 2) {
+#else
+ if (global_capture_opts.ifaces->len < 4) {
+#endif
+ for (i = 0; i < global_capture_opts.ifaces->len; i++) {
+ interface_options interface_opts;
+
+ interface_opts = g_array_index(global_capture_opts.ifaces, interface_options, i);
+ if (i > 0) {
+ if (global_capture_opts.ifaces->len > 2) {
+ g_string_append_printf(str, ",");
+ }
+ g_string_append_printf(str, " ");
+ if (i == global_capture_opts.ifaces->len - 1) {
+ g_string_append_printf(str, "and ");
+ }
+ }
+ g_string_append_printf(str, "%s", interface_opts.descr);
}
- g_string_append_printf(str, "%s", interface_opts.descr);
+ } else {
+ g_string_append_printf(str, "%u interfaces", global_capture_opts.ifaces->len);
}
fprintf(stderr, "Capturing on %s\n", str->str);
g_string_free(str, TRUE);