From 0dfbc73cbedd0d1b88218eb594f88bc98c583faf Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 1 May 2006 06:51:14 +0000 Subject: Handle the case where we *can't* determine the pathname in which to find programs, by reporting it with a dialog box that at least attempts to indicate what the problem is, and by giving up early on running dumpcap. svn path=/trunk/; revision=18051 --- gtk/about_dlg.c | 6 ++++-- gtk/main.c | 11 ++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'gtk') diff --git a/gtk/about_dlg.c b/gtk/about_dlg.c index 7d0401d0c0..41abeb370d 100644 --- a/gtk/about_dlg.c +++ b/gtk/about_dlg.c @@ -234,8 +234,10 @@ about_folders_page_new(void) /* global conf */ constpath = get_datafile_dir(); - about_folders_row(table, "Global configuration", constpath, - "\"dfilters\", \"preferences\", \"manuf\", ..."); + if (constpath != NULL) { + about_folders_row(table, "Global configuration", constpath, + "\"dfilters\", \"preferences\", \"manuf\", ..."); + } /* system */ constpath = get_systemfile_dir(); diff --git a/gtk/main.c b/gtk/main.c index daa70992eb..ba6e4f6b15 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1876,6 +1876,7 @@ static void main_cf_callback(gint event, gpointer data, gpointer user_data _U_) int main(int argc, char *argv[]) { + char *init_progfile_dir_error; char *s; int i; int opt; @@ -1928,7 +1929,7 @@ main(int argc, char *argv[]) /* * Attempt to get the pathname of the executable file. */ - init_progfile_dir(argv[0]); + init_progfile_dir_error = init_progfile_dir(argv[0]); /* * Get credential information for later use. @@ -2103,6 +2104,14 @@ main(int argc, char *argv[]) /* We won't come till here, if we had a "console only" command line parameter. */ splash_win = splash_new("Loading Ethereal ..."); + if (init_progfile_dir_error != NULL) { + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, + "Can't get pathname of Ethereal: %s.\n" + "It won't be possible to capture traffic.\n" + "Report this to the Ethereal developers.", + init_progfile_dir_error); + g_free(init_progfile_dir_error); + } splash_update(splash_win, "Init dissectors ..."); -- cgit v1.2.3