diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2009-12-21 17:39:37 +0000 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2009-12-21 17:39:37 +0000 |
commit | 2ab6b0f8eb121039da65297129ab495b824b45f2 (patch) | |
tree | 58d984a30a7ac37ef0de9dc42ba3a6093c41c30a /epan/filesystem.c | |
parent | 1925a4f5eb2f16a4e3109b26557782e393066b94 (diff) |
Small rewrite for glib < 2.14 to make it work more than once.
svn path=/trunk/; revision=31340
Diffstat (limited to 'epan/filesystem.c')
-rw-r--r-- | epan/filesystem.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/epan/filesystem.c b/epan/filesystem.c index 71e2ac1972..a9aa16f4c8 100644 --- a/epan/filesystem.c +++ b/epan/filesystem.c @@ -1266,11 +1266,11 @@ create_persconffile_dir(char **pf_dir_path_return) } #if ! GLIB_CHECK_VERSION(2,14,0) -GList *files = NULL; static void -hash_table_get_keys(gpointer key, gpointer value _U_, gpointer user_data _U_) +hash_table_get_keys(gpointer key, gpointer value _U_, gpointer user_data) { - files = g_list_append (files, key); + GList **files = ((GList **)user_data); + *files = g_list_append (*files, key); } #endif @@ -1281,12 +1281,13 @@ copy_persconffile_profile(const char *toname, const char *fromname, char **pf_fi gchar *from_dir = g_strdup (get_persconffile_dir(fromname)); gchar *to_dir = g_strdup (get_persconffile_dir(toname)); gchar *filename, *from_file, *to_file; - GList *file; + GList *files, *file; #if GLIB_CHECK_VERSION(2,14,0) - GList *files = g_hash_table_get_keys(profile_files); + files = g_hash_table_get_keys(profile_files); #else - g_hash_table_foreach (profile_files, hash_table_get_keys, NULL); + files = NULL; + g_hash_table_foreach(profile_files, hash_table_get_keys, &files); #endif file = g_list_first(files); |