aboutsummaryrefslogtreecommitdiffstats
path: root/filters.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2001-10-23 05:01:02 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2001-10-23 05:01:02 +0000
commit4da81b99c3d1096c67b26e0d6f7a4f6557717655 (patch)
tree6b6ced95b0d95cc2f7243f2ff7546552b12f4dfa /filters.c
parentaedae5e4abbc93cc5945b1c448a4c1ce26ac9479 (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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4065 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'filters.c')
-rw-r--r--filters.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/filters.c b/filters.c
index 5c115e0b43..9433b244ab 100644
--- a/filters.c
+++ b/filters.c
@@ -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);