mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-25 05:10:29 -04:00
update env instead of overwrite
This commit is contained in:
parent
0ddc2fdfbe
commit
8268ecb5f4
@ -16,10 +16,14 @@ int main() {
|
||||
|
||||
char cwd[1024];
|
||||
|
||||
char * previous_env = getenv("LD_LIBRARY_PATH");
|
||||
if (getcwd(cwd, sizeof(cwd)) != NULL) {
|
||||
char env[1024] = "LD_LIBRARY_PATH=";
|
||||
strcat(env, cwd);
|
||||
strcat(env, ":");
|
||||
strcat(env, previous_env);
|
||||
putenv(env);
|
||||
// fprintf(stdout, "LD_LIBRARY_PATH: %s\n", env);
|
||||
// fprintf(stdout, "Current working dir: %s\n", cwd);
|
||||
} else
|
||||
perror("Unable to find current directory");
|
||||
|
Loading…
x
Reference in New Issue
Block a user