From: Alexander Butenko Date: Mon, 21 Dec 2009 22:36:22 +0000 (+0100) Subject: Only monitor actually existing user script/ style folders X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eddb3ef55773d20865cf6d5c67232ab9b499517d;p=midori Only monitor actually existing user script/ style folders --- diff --git a/panels/midori-addons.c b/panels/midori-addons.c index efeec635..091e5904 100644 --- a/panels/midori-addons.c +++ b/panels/midori-addons.c @@ -22,9 +22,14 @@ #include #include #include +#include #include #include +#if HAVE_UNISTD_H + #include +#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++; } }