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 /prefs.c | |
parent | 04147b7dcf4e435dab2f6aa141e0e8dec7b88b06 (diff) | |
download | wireshark-cf5a1d86e7280ec6b26a258238dd3fb3d6b31f59.tar.gz wireshark-cf5a1d86e7280ec6b26a258238dd3fb3d6b31f59.tar.bz2 wireshark-cf5a1d86e7280ec6b26a258238dd3fb3d6b31f59.zip |
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 'prefs.c')
-rw-r--r-- | prefs.c | 23 |
1 files changed, 1 insertions, 22 deletions
@@ -1,7 +1,7 @@ /* prefs.c * Routines for handling preferences * - * $Id: prefs.c,v 1.66 2001/10/22 22:59:23 guy Exp $ + * $Id: prefs.c,v 1.67 2001/10/23 05:00:57 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -30,10 +30,6 @@ #include <sys/types.h> #endif -#ifdef HAVE_DIRECT_H -#include <direct.h> -#endif - #include <stdlib.h> #include <string.h> #include <ctype.h> @@ -43,10 +39,6 @@ #include <unistd.h> #endif -#ifdef HAVE_SYS_STAT_H -#include <sys/stat.h> -#endif - #include <filesystem.h> #include "globals.h" #include "packet.h" @@ -1463,10 +1455,8 @@ write_module_prefs(gpointer data, gpointer user_data) int write_prefs(const char **pf_path_return) { - const char *pf_dir_path; const char *pf_path; FILE *pf; - struct stat s_buf; GList *clp, *col_l; fmt_data *cfmt; @@ -1476,17 +1466,6 @@ write_prefs(const char **pf_path_return) * so that duplication can be avoided with filter.c */ - /* - * Create the directory that holds personal configuration files. - */ - 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 - pf_path = get_preffile_path(); if ((pf = fopen(pf_path, "w")) == NULL) { *pf_path_return = pf_path; |