]> spindle.queued.net Git - midori/commitdiff
Double check that we're not adding addons twice
authorPaweł Forysiuk <tuxator@o2.pl>
Thu, 26 May 2011 19:05:07 +0000 (21:05 +0200)
committerChristian Dywan <christian@twotoasts.de>
Thu, 26 May 2011 19:05:07 +0000 (21:05 +0200)
extensions/addons.c

index aeb948bd7016ba85dbce8618835cd5c428213736..08eb2abc80fec59ae78a98131d7f557977b39568 100644 (file)
@@ -843,7 +843,7 @@ addons_get_directories (AddonsKind kind)
     {
         path = g_build_path (G_DIR_SEPARATOR_S, *datadirs,
                              PACKAGE_NAME, folder_name, NULL);
-        if (g_access (path, X_OK) == 0)
+        if (g_slist_find (directories, path) == NULL && g_access (path, X_OK) == 0)
             directories = g_slist_prepend (directories, path);
         else
             g_free (path);
@@ -888,7 +888,8 @@ addons_get_files (AddonsKind kind)
                 if (g_str_has_suffix (filename, file_extension))
                 {
                     fullname = g_build_filename (dirname, filename, NULL);
-                    files = g_slist_prepend (files, fullname);
+                    if (g_slist_find (files, fullname) == NULL)
+                        files = g_slist_prepend (files, fullname);
                 }
             }
             g_dir_close (addon_dir);