forked from enlightenment/efl
do not add duplicate search paths to module loader.
usually libevas.so/../evas/modules is the same as libdir/evas/modules, so avoid adding it twice. SVN revision: 41059
This commit is contained in:
parent
a7a2419ac3
commit
6760437fdd
|
@ -40,8 +40,8 @@ _evas_module_append(Eina_List *list, char *path)
|
||||||
void
|
void
|
||||||
evas_module_paths_init(void)
|
evas_module_paths_init(void)
|
||||||
{
|
{
|
||||||
char *prefix;
|
char *path, *path2;
|
||||||
char *path;
|
const char *path3;
|
||||||
|
|
||||||
/* 1. ~/.evas/modules/ */
|
/* 1. ~/.evas/modules/ */
|
||||||
path = eina_module_environment_path_get("HOME", "/.evas/modules");
|
path = eina_module_environment_path_get("HOME", "/.evas/modules");
|
||||||
|
@ -52,16 +52,20 @@ evas_module_paths_init(void)
|
||||||
evas_module_paths = _evas_module_append(evas_module_paths, path);
|
evas_module_paths = _evas_module_append(evas_module_paths, path);
|
||||||
|
|
||||||
/* 3. libevas.so/../evas/modules/ */
|
/* 3. libevas.so/../evas/modules/ */
|
||||||
path = eina_module_symbol_path_get(evas_module_paths_init, "/evas/modules");
|
path2 = eina_module_symbol_path_get(evas_module_paths_init, "/evas/modules");
|
||||||
evas_module_paths = _evas_module_append(evas_module_paths, path);
|
if (path2 && path && (strcmp(path, path2) == 0))
|
||||||
|
free(path2);
|
||||||
|
else
|
||||||
|
evas_module_paths = _evas_module_append(evas_module_paths, path2);
|
||||||
|
|
||||||
/* 4. PREFIX/evas/modules/ */
|
/* 4. PREFIX/evas/modules/ */
|
||||||
prefix = PACKAGE_LIB_DIR;
|
path3 = PACKAGE_LIB_DIR "/evas/modules";
|
||||||
path = malloc(strlen(prefix) + 1 + strlen("/evas/modules"));
|
if ((path && (strcmp(path, path3) != 0)) ||
|
||||||
if (path)
|
(path2 && (strcmp(path2, path3) != 0)) ||
|
||||||
|
(!path && !path2))
|
||||||
{
|
{
|
||||||
strcpy(path, prefix);
|
path = strdup(path3);
|
||||||
strcat(path, "/evas/modules");
|
if (path)
|
||||||
evas_module_paths = _evas_module_append(evas_module_paths, path);
|
evas_module_paths = _evas_module_append(evas_module_paths, path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue