diff options
author | Guy Harris <guy@alum.mit.edu> | 2007-05-25 20:03:26 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2007-05-25 20:03:26 +0000 |
commit | ab5a09f4debca6332200002cdea7f4a06bf7683e (patch) | |
tree | 95d208a99169ab2b09294d8187fadc01130f0adf | |
parent | 88f69b80c0b4a4c476d00c1207b99d26d84e8e6a (diff) |
No need to call init_plugin_dir() - it gets called, if necessary, by
get_plugin_dir().
Add checks for the success or failure of init_progfile_dir() in dftest.
svn path=/trunk/; revision=21942
-rw-r--r-- | dftest.c | 12 | ||||
-rw-r--r-- | epan/filesystem.c | 2 | ||||
-rw-r--r-- | epan/filesystem.h | 10 |
3 files changed, 10 insertions, 14 deletions
@@ -59,6 +59,7 @@ static void read_failure_message(const char *filename, int err); int main(int argc, char **argv) { + char *init_progfile_dir_error; char *text; char *gpf_path, *pf_path; int gpf_open_errno, gpf_read_errno; @@ -74,12 +75,11 @@ main(int argc, char **argv) /* * Attempt to get the pathname of the executable file. */ - init_progfile_dir(argv[0]); - - /* - * Now attempt to get the pathname of the plugins. - */ - init_plugin_dir(); + init_progfile_dir_error = init_progfile_dir(argv[0]); + if (init_progfile_dir_error != NULL) { + fprintf(stderr, "dftest: Can't get pathname of dftest program: %s.\n", + init_progfile_dir_error); + } timestamp_set_type(TS_RELATIVE); diff --git a/epan/filesystem.c b/epan/filesystem.c index cd9bb0396b..21c55658ea 100644 --- a/epan/filesystem.c +++ b/epan/filesystem.c @@ -638,7 +638,7 @@ get_datafile_dir(void) */ static const char *plugin_dir = NULL; -void +static void init_plugin_dir(void) { #ifdef _WIN32 diff --git a/epan/filesystem.h b/epan/filesystem.h index 0f5cbf7df4..d667ea4b68 100644 --- a/epan/filesystem.h +++ b/epan/filesystem.h @@ -38,13 +38,9 @@ extern char *init_progfile_dir(const char *arg0); extern const char *get_progfile_dir(void); /* - * Find the directory in which plugins are stored; this must be called - * after init_progfile_dir() is called. - */ -extern void init_plugin_dir(void); - -/* - * Get the directory in which plugins are stored. + * Get the directory in which plugins are stored; this must not be called + * before init_progfile_dir() is called, as they might be stored in a + * subdirectory of the program file directory. */ extern const char *get_plugin_dir(void); |