Commit 6b85162f authored by Chris Lamb's avatar Chris Lamb Committed by Matthias Clasen

gtk/queryimmodules.c: Make the output deterministic.

Whilst working on the Reproducible Builds effort [0], we noticed that
queryimmodules generates non-reproducible output as it iterates over the
filesystem without sorting.

Patch attached.

 [0] https://reproducible-builds.org/Signed-off-by: 's avatarChris Lamb <lamby@debian.org>

https://bugzilla.gnome.org/show_bug.cgi?id=786528
parent 53bc2566
......@@ -200,13 +200,19 @@ G_GNUC_END_IGNORE_DEPRECATIONS
if (dir)
{
const char *dent;
GList *list = NULL, *iterator = NULL;
while ((dent = g_dir_read_name (dir)))
list = g_list_prepend (list, g_strdup (dent));
list = g_list_sort (list, (GCompareFunc) strcmp);
for (iterator = list; iterator; iterator = iterator->next)
{
if (g_str_has_suffix (dent, SOEXT))
error |= query_module (dirs[i], dent, contents);
if (g_str_has_suffix (iterator->data, SOEXT))
error |= query_module (dirs[i], iterator->data, contents);
}
g_list_free_full (list, g_free);
g_dir_close (dir);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment