]> spindle.queued.net Git - midori/commitdiff
Check for folders other than LIBDIR in sokoke_find_lib_path
authorPaweł Forysiuk <tuxator@o2.pl>
Mon, 29 Aug 2011 17:13:24 +0000 (19:13 +0200)
committerChristian Dywan <christian@twotoasts.de>
Tue, 13 Sep 2011 23:47:21 +0000 (01:47 +0200)
midori/sokoke.c

index c71864c2740fb416396c50c134ee1d2e7822bd03..c83e0cb12a859e38bcf1bb659397e4be9a1cf079 100644 (file)
@@ -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;