diff options
Diffstat (limited to 'capinfos.c')
-rw-r--r-- | capinfos.c | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/capinfos.c b/capinfos.c index d1773113b4..a6539cc672 100644 --- a/capinfos.c +++ b/capinfos.c @@ -1405,6 +1405,7 @@ main(int argc, char *argv[]) { GString *comp_info_str; GString *runtime_info_str; + char *init_progfile_dir_error; wtap *wth; int err; gchar *err_info; @@ -1417,9 +1418,6 @@ main(int argc, char *argv[]) }; int status = 0; -#ifdef HAVE_PLUGINS - char *init_progfile_dir_error; -#endif #ifdef HAVE_LIBGCRYPT FILE *fh; char *hash_buf = NULL; @@ -1459,26 +1457,33 @@ main(int argc, char *argv[]) */ init_process_policies(); + /* + * Attempt to get the pathname of the directory containing the + * executable file. + */ + init_progfile_dir_error = init_progfile_dir(argv[0], main); + if (init_progfile_dir_error != NULL) { + fprintf(stderr, + "capinfos: Can't get pathname of directory containing the capinfos program: %s.\n", + init_progfile_dir_error); + g_free(init_progfile_dir_error); + } + wtap_init(); #ifdef HAVE_PLUGINS - if ((init_progfile_dir_error = init_progfile_dir(argv[0], main))) { - g_warning("capinfos: init_progfile_dir(): %s", init_progfile_dir_error); - g_free(init_progfile_dir_error); - } else { - init_report_err(failure_message, NULL, NULL, NULL); + init_report_err(failure_message, NULL, NULL, NULL); - /* Scan for plugins. This does *not* call their registration routines; - that's done later. + /* Scan for plugins. This does *not* call their registration routines; + that's done later. - Don't report failures to load plugins because most (non-wiretap) - plugins *should* fail to load (because we're not linked against - libwireshark and dissector plugins need libwireshark). */ - scan_plugins(DONT_REPORT_LOAD_FAILURE); + Don't report failures to load plugins because most (non-wiretap) + plugins *should* fail to load (because we're not linked against + libwireshark and dissector plugins need libwireshark). */ + scan_plugins(DONT_REPORT_LOAD_FAILURE); - /* Register all libwiretap plugin modules. */ - register_all_wiretap_modules(); - } + /* Register all libwiretap plugin modules. */ + register_all_wiretap_modules(); #endif /* Process the options */ |