aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/colors.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2001-10-24 07:18:39 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2001-10-24 07:18:39 +0000
commitdea6d97bf111b903463a6178ef359c7219b3c070 (patch)
treeef5a0eee067a920b7bbe92f3f75ae7e64d502eb5 /gtk/colors.c
parent6f4c24f0439d964aee9ba65296ef6f6944801acc (diff)
Have a routine that takes a file name for a personal configuration file
and generates the path name; have it, if the file is to be opened for reading on Win32, check whether it exists and, if not, check for it in the old home directory-based configuration directory and, if so, return that path instead, so that files saved with earlier versions of Ethereal will be seen. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4072 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'gtk/colors.c')
-rw-r--r--gtk/colors.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/gtk/colors.c b/gtk/colors.c
index cebf124d23..cd1c0da016 100644
--- a/gtk/colors.c
+++ b/gtk/colors.c
@@ -1,7 +1,7 @@
/* colors.c
* Definitions for color structures and routines
*
- * $Id: colors.c,v 1.14 2001/10/24 06:13:06 guy Exp $
+ * $Id: colors.c,v 1.15 2001/10/24 07:18:39 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -162,24 +162,6 @@ delete_color_filter(color_filter_t *colorf)
g_free(colorf);
}
-/*
- * Get the pathname of the preferences file.
- */
-static const char *
-get_colorfilter_file_path(void)
-{
- static gchar *cf_path = NULL;
- static const char fname[] = "colorfilters";
-
- if (cf_path == NULL) {
- cf_path = (gchar *) g_malloc(strlen(get_persconffile_dir()) +
- sizeof fname + 1);
- sprintf(cf_path, "%s" G_DIR_SEPARATOR_S "%s", get_persconffile_dir(),
- fname);
- }
- return cf_path;
-}
-
static gboolean
read_filters(colfilter *filter)
{
@@ -203,7 +185,7 @@ read_filters(colfilter *filter)
return FALSE;
/* we have a clist */
- path = get_colorfilter_file_path();
+ path = get_persconffile_path("colorfilters", FALSE);
if ((f = fopen(path, "r")) == NULL) {
if (errno != ENOENT) {
simple_dialog(ESD_TYPE_CRIT, NULL,
@@ -302,7 +284,7 @@ write_filters(colfilter *filter)
return FALSE;
}
- path = get_colorfilter_file_path();
+ path = get_persconffile_path("colorfilters", TRUE);
if ((f = fopen(path, "w+")) == NULL) {
simple_dialog(ESD_TYPE_CRIT, NULL,
"Could not open\n%s\nfor writing: %s.",