From 18a0d1da035b40ce653739fe36df0542d49e5a01 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pawe=C5=82=20Forysiuk?= Date: Mon, 29 Aug 2011 19:13:24 +0200 Subject: [PATCH] Check for folders other than LIBDIR in sokoke_find_lib_path --- midori/sokoke.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/midori/sokoke.c b/midori/sokoke.c index c71864c2..c83e0cb1 100644 --- a/midori/sokoke.c +++ b/midori/sokoke.c @@ -1732,9 +1732,23 @@ gchar* sokoke_find_lib_path (const gchar* folder) if (g_access (lib_path, F_OK) == 0) return lib_path; #else - gchar* lib_path = g_build_filename (LIBDIR, folder ? folder : "", NULL); - if (g_access (lib_path, F_OK) == 0) - return lib_path; + const gchar* lib_dirs[] = + { + LIBDIR, + "/usr/local/lib", + "/usr/lib", + NULL + }; + guint i; + + for (i = 0; i < G_N_ELEMENTS (lib_dirs); i++) + { + gchar* lib_path = g_build_filename (lib_dirs[i], folder ? folder : "", NULL); + if (g_access (lib_path, F_OK) == 0) + return lib_path; + else + g_free (lib_path); + } #endif return NULL; -- 2.39.5