Commit 8294ca9d authored by Michael Natterer's avatar Michael Natterer 😴

Bug 784502 - Multiple identical path entries for resources cause...

...resources to be loaded and shown multiple times

Change gimp_path_parse() to filter out duplicate paths. This is the
function at the bottom which is used by everything else, so should
generically catch all duplicates.
parent 5ff92185
......@@ -957,9 +957,24 @@ gimp_path_parse (const gchar *path,
exists = g_file_test (dir->str, G_FILE_TEST_IS_DIR);
if (exists)
list = g_list_prepend (list, g_strdup (dir->str));
{
GList *dup;
/* check for duplicate entries, see bug #784502 */
for (dup = list; dup; dup = g_list_next (dup))
{
if (! strcmp (dir->str, dup->data))
break;
}
/* only add to the list if it's not a duplicate */
if (! dup)
list = g_list_prepend (list, g_strdup (dir->str));
}
else if (check_failed)
fail_list = g_list_prepend (fail_list, g_strdup (dir->str));
{
fail_list = g_list_prepend (fail_list, g_strdup (dir->str));
}
g_string_free (dir, TRUE);
}
......
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