diff options
| author | Bernhard M. Wiedemann <bwiedemann@suse.de> | 2018-08-15 03:11:21 +0200 |
|---|---|---|
| committer | Bernhard M. Wiedemann <bwiedemann@suse.de> | 2018-08-15 03:15:14 +0200 |
| commit | b364827a5b99e3b02862f36be4c03826e72aefba (patch) | |
| tree | 6e6bbd8f64e68cd7a459c9430b31c8cb38679ef7 | |
| parent | bbe362d015e4e389fb4ea23dc2e62530e64b5d19 (diff) | |
| download | gtk+-b364827a5b99e3b02862f36be4c03826e72aefba.tar.gz | |
updateiconcache: Sort list of entries
because filesystem readdir order is indeterministic.
Without this patch, building openSUSE's balsa package
had variations between builds in /usr/share/balsa/icon-theme.cache
| -rw-r--r-- | gtk/updateiconcache.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gtk/updateiconcache.c b/gtk/updateiconcache.c index cc681c16be..507c790b41 100644 --- a/gtk/updateiconcache.c +++ b/gtk/updateiconcache.c @@ -595,6 +595,7 @@ scan_directory (const gchar *base_path, { GHashTable *dir_hash; GDir *dir; + GList *list = NULL, *iterator = NULL; const gchar *name; gchar *dir_path; gboolean dir_added = FALSE; @@ -612,6 +613,13 @@ scan_directory (const gchar *base_path, while ((name = g_dir_read_name (dir))) { + list = g_list_prepend (list, g_strdup (name)); + } + list = g_list_sort (list, (GCompareFunc) strcmp); + for (iterator = list; iterator; iterator = iterator->next) + { + name = iterator->data; + gchar *path; gboolean retval; int flags = 0; @@ -690,6 +698,7 @@ scan_directory (const gchar *base_path, g_free (path); } + g_list_free_full (list, g_free); g_dir_close (dir); /* Move dir into the big file hash */ |
