Check for folders other than LIBDIR in sokoke_find_lib_path

This commit is contained in:
Paweł Forysiuk 2011-08-29 19:13:24 +02:00 committed by Christian Dywan
parent c1321b0072
commit 18a0d1da03

View file

@ -1732,9 +1732,23 @@ gchar* sokoke_find_lib_path (const gchar* folder)
if (g_access (lib_path, F_OK) == 0) if (g_access (lib_path, F_OK) == 0)
return lib_path; return lib_path;
#else #else
gchar* lib_path = g_build_filename (LIBDIR, folder ? folder : "", NULL); const gchar* lib_dirs[] =
if (g_access (lib_path, F_OK) == 0) {
return lib_path; 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 #endif
return NULL; return NULL;