frame: print debug line according to new console preference.
[metze/wireshark/wip.git] / tshark.c
index b4924a3f96701b8e47eeedb1b9198d9f55f89738..805fe5a8da451d1190b83f3be3b99ce4d421636f 100644 (file)
--- a/tshark.c
+++ b/tshark.c
@@ -75,6 +75,7 @@
 #include <epan/disabled_protos.h>
 #include <epan/prefs.h>
 #include <epan/column.h>
+#include <epan/decode_as.h>
 #include <epan/print.h>
 #include <epan/addr_resolv.h>
 #ifdef HAVE_LIBPCAP
@@ -791,7 +792,7 @@ main(int argc, char *argv[])
 
   /* Scan for plugins.  This does *not* call their registration routines;
      that's done later. */
-  scan_plugins();
+  scan_plugins(REPORT_LOAD_FAILURE);
 
   /* Register all libwiretap plugin modules. */
   register_all_wiretap_modules();
@@ -813,6 +814,9 @@ main(int argc, char *argv[])
      by stats_tree_stat.c and need to registered before that */
 #ifdef HAVE_PLUGINS
   register_all_plugin_tap_listeners();
+#endif
+#ifdef HAVE_EXTCAP
+  extcap_register_preferences();
 #endif
   register_all_tap_listeners();
   conversation_table_set_gui_info(init_iousers);
@@ -829,18 +833,11 @@ main(int argc, char *argv[])
      XXX - we do this here, for now, to support "-G" with no arguments.
      If none of our build or other processes uses "-G" with no arguments,
      we can just process it with the other arguments. */
-fprintf(stderr, "Checking for -G\n");
   if (argc >= 2 && strcmp(argv[1], "-G") == 0) {
-fprintf(stderr, "-G detected\n");
     proto_initialize_all_prefixes();
-fprintf(stderr, "proto_initialize_all_prefixes() returned\n");
 
     if (argc == 2)
-{
-fprintf(stderr, "calling proto_registrar_dump_fields()\n");
       proto_registrar_dump_fields();
-fprintf(stderr, "proto_registrar_dump_fields() returned\n");
-}
     else {
       if (strcmp(argv[2], "column-formats") == 0)
         column_dump_column_formats();
@@ -885,7 +882,6 @@ fprintf(stderr, "proto_registrar_dump_fields() returned\n");
         return 1;
       }
     }
-fprintf(stderr, "About to return\n");
     return 0;
   }
 
@@ -1318,10 +1314,10 @@ fprintf(stderr, "About to return\n");
        * cruft getting in the way. Makes the results of running
        * $ ./tools/valgrind-wireshark -n
        * much more useful. */
+      epan_cleanup();
 #ifdef HAVE_EXTCAP
       extcap_cleanup();
 #endif
-      epan_cleanup();
       return 0;
     case 'O':        /* Only output these protocols */
       /* already processed; just ignore it now */
@@ -1740,10 +1736,10 @@ fprintf(stderr, "About to return\n");
     if (!dfilter_compile(rfilter, &rfcode, &err_msg)) {
       cmdarg_err("%s", err_msg);
       g_free(err_msg);
+      epan_cleanup();
 #ifdef HAVE_EXTCAP
       extcap_cleanup();
 #endif
-      epan_cleanup();
 #ifdef HAVE_PCAP_OPEN_DEAD
       {
         pcap_t *pc;
@@ -1769,10 +1765,10 @@ fprintf(stderr, "About to return\n");
     if (!dfilter_compile(dfilter, &dfcode, &err_msg)) {
       cmdarg_err("%s", err_msg);
       g_free(err_msg);
+      epan_cleanup();
 #ifdef HAVE_EXTCAP
       extcap_cleanup();
 #endif
-      epan_cleanup();
 #ifdef HAVE_PCAP_OPEN_DEAD
       {
         pcap_t *pc;
@@ -1883,10 +1879,10 @@ fprintf(stderr, "About to return\n");
      * We're reading a capture file.
      */
     if (cf_open(&cfile, cf_name, in_file_type, FALSE, &err) != CF_OK) {
+      epan_cleanup();
 #ifdef HAVE_EXTCAP
       extcap_cleanup();
 #endif
-      epan_cleanup();
       return 2;
     }
 
@@ -2047,10 +2043,10 @@ fprintf(stderr, "About to return\n");
   draw_tap_listeners(TRUE);
   funnel_dump_all_text_windows();
   epan_free(cfile.epan);
+  epan_cleanup();
 #ifdef HAVE_EXTCAP
   extcap_cleanup();
 #endif
-  epan_cleanup();
 
   output_fields_free(output_fields);
   output_fields = NULL;
@@ -3603,8 +3599,8 @@ print_columns(capture_file *cf)
     switch (col_item->col_fmt) {
     case COL_NUMBER:
       column_len = col_len = strlen(col_item->col_data);
-      if (column_len < 3)
-        column_len = 3;
+      if (column_len < 5)
+        column_len = 5;
       line_bufp = get_line_buf(buf_offset + column_len);
       put_spaces_string(line_bufp + buf_offset, col_item->col_data, col_len, column_len);
       break;