diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-10-24 07:18:39 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-10-24 07:18:39 +0000 |
commit | 509f30374efd07a3efeaa367f7f48dfae765f97e (patch) | |
tree | ef5a0eee067a920b7bbe92f3f75ae7e64d502eb5 /gtk/colors.c | |
parent | d453f6d99253d5946a4c150c57a7ab8bce2a0715 (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.
svn path=/trunk/; revision=4072
Diffstat (limited to 'gtk/colors.c')
-rw-r--r-- | gtk/colors.c | 24 |
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.", |