diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-10-23 05:01:02 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-10-23 05:01:02 +0000 |
commit | cf5a1d86e7280ec6b26a258238dd3fb3d6b31f59 (patch) | |
tree | 6b6ced95b0d95cc2f7243f2ff7546552b12f4dfa /filters.c | |
parent | 04147b7dcf4e435dab2f6aa141e0e8dec7b88b06 (diff) |
Add a new routine to create the ".ethereal" directory for a user.
Use that routine rather than duplicating that code in the routines to
write out the preference file and filter files.
Use it in the code for the color filter dialog, so that the directory in
question is created if necessary.
As that routine returns an error indication, have the code that calls
that routine put up a message box if the attempt fails.
svn path=/trunk/; revision=4065
Diffstat (limited to 'filters.c')
-rw-r--r-- | filters.c | 18 |
1 files changed, 1 insertions, 17 deletions
@@ -1,7 +1,7 @@ /* filters.c * Code for reading and writing the filters file. * - * $Id: filters.c,v 1.11 2001/10/22 22:59:23 guy Exp $ + * $Id: filters.c,v 1.12 2001/10/23 05:00:57 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -31,18 +31,10 @@ #include <ctype.h> #include <errno.h> -#ifdef HAVE_SYS_STAT_H -#include <sys/stat.h> -#endif - #ifdef HAVE_UNISTD_H #include <unistd.h> #endif -#ifdef HAVE_DIRECT_H -#include <direct.h> /* to declare "mkdir()" on Windows */ -#endif - #include <glib.h> #include <filesystem.h> @@ -425,7 +417,6 @@ save_filter_list(filter_list_type_t list, char **pref_path_return, GList *flp; filter_def *filt; FILE *ff; - struct stat s_buf; guchar *p, c; *pref_path_return = NULL; /* assume no error */ @@ -448,13 +439,6 @@ save_filter_list(filter_list_type_t list, char **pref_path_return, } pf_dir_path = get_persconffile_dir(); - if (stat(pf_dir_path, &s_buf) != 0) -#ifdef WIN32 - mkdir(pf_dir_path); -#else - mkdir(pf_dir_path, 0755); -#endif - path_length = strlen(pf_dir_path) + strlen(ff_name) + 2; ff_path = (gchar *) g_malloc(path_length); sprintf(ff_path, "%s" G_DIR_SEPARATOR_S "%s", pf_dir_path, ff_name); |