From: Paweł Forysiuk Date: Mon, 29 Aug 2011 17:13:24 +0000 (+0200) Subject: Check for folders other than LIBDIR in sokoke_find_lib_path X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=18a0d1da035b40ce653739fe36df0542d49e5a01;p=midori Check for folders other than LIBDIR in sokoke_find_lib_path --- 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;