]> spindle.queued.net Git - midori/commitdiff
Only monitor actually existing user script/ style folders
authorAlexander Butenko <a.butenka@gmail.com>
Mon, 21 Dec 2009 22:36:22 +0000 (23:36 +0100)
committerChristian Dywan <christian@twotoasts.de>
Mon, 21 Dec 2009 22:40:29 +0000 (23:40 +0100)
panels/midori-addons.c

index efeec635ff0066ca796f75737e2bd98320908f12..091e5904340e43ee599fde0394b881f271b39136 100644 (file)
 #include <webkit/webkit.h>
 #include <JavaScriptCore/JavaScript.h>
 #include <glib/gi18n.h>
+#include <glib/gstdio.h>
 #include <string.h>
 #include <gio/gio.h>
 
+#if HAVE_UNISTD_H
+    #include <unistd.h>
+#endif
+
 struct _MidoriAddons
 {
     GtkVBox parent_instance;
@@ -212,14 +217,20 @@ _addons_get_directories (MidoriAddons* addons)
     {
         path = g_build_path (G_DIR_SEPARATOR_S, g_get_user_data_dir (),
                              PACKAGE_NAME, folders[i], NULL);
-        directories = g_slist_prepend (directories, path);
+        if (g_access (path, X_OK) == 0)
+            directories = g_slist_prepend (directories, path);
+        else
+            g_free (path);
 
         datadirs = g_get_system_data_dirs ();
         while (*datadirs)
         {
             path = g_build_path (G_DIR_SEPARATOR_S, *datadirs,
                                  PACKAGE_NAME, folders[i], NULL);
-            directories = g_slist_prepend (directories, path);
+            if (g_access (path, X_OK) == 0)
+                directories = g_slist_prepend (directories, path);
+            else
+                g_free (path);
             datadirs++;
         }
     }