diff options
-rw-r--r-- | libpeas/peas-engine.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libpeas/peas-engine.c b/libpeas/peas-engine.c index 9929f69..b6eee05 100644 --- a/libpeas/peas-engine.c +++ b/libpeas/peas-engine.c @@ -23,6 +23,7 @@ #include "config.h" +#include <stdlib.h> #include <string.h> #include "peas-i18n-priv.h" @@ -241,6 +242,16 @@ load_file_dir_real (PeasEngine *engine, return found; } +static int +strptrcmp (gconstpointer a, + gconstpointer b) +{ + const char * const *stra = a; + const char * const *strb = b; + + return strcmp (*stra, *strb); +} + static gboolean load_resource_dir_real (PeasEngine *engine, const gchar *module_dir, @@ -267,6 +278,9 @@ load_resource_dir_real (PeasEngine *engine, return FALSE; } + /* Always sort resource children for improved reproducibility */ + qsort (children, g_strv_length (children), sizeof (char *), strptrcmp); + for (i = 0; children[i] != NULL; ++i) { gboolean is_dir; |