commit 879c9c24e9cdb7c86f7c4b392346113b23f004bc
parent 71a91ad6c98d69a9784ad4556e67df18840b1ac4
Author: Christian Grothoff <christian@grothoff.org>
Date: Sat, 11 Nov 2006 22:28:18 +0000
do not kill existing ld search paths
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/main/extractor.c b/src/main/extractor.c
@@ -499,6 +499,7 @@ void __attribute__ ((constructor)) le_ltdl_init() {
int err;
const char * opath;
char * path;
+ char * cpath;
#if ENABLE_NLS
setlocale(LC_ALL, "");
@@ -519,8 +520,13 @@ void __attribute__ ((constructor)) le_ltdl_init() {
old_dlsearchpath = strdup(opath);
path = os_get_installation_path();
if (path != NULL) {
- lt_dlsetsearchpath(path);
+ cpath = malloc(strlen(path) + strlen(opath) + 4);
+ strcpy(cpath, opath);
+ strcat(cpath, ":");
+ strcat(cpath, path);
+ lt_dlsetsearchpath(cpath);
free(path);
+ free(cpath);
}
#ifdef MINGW
InitWinEnv();