mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-26 13:50:33 -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 cwd[1024];
|
||||||
|
|
||||||
|
char * previous_env = getenv("LD_LIBRARY_PATH");
|
||||||
if (getcwd(cwd, sizeof(cwd)) != NULL) {
|
if (getcwd(cwd, sizeof(cwd)) != NULL) {
|
||||||
char env[1024] = "LD_LIBRARY_PATH=";
|
char env[1024] = "LD_LIBRARY_PATH=";
|
||||||
strcat(env, cwd);
|
strcat(env, cwd);
|
||||||
|
strcat(env, ":");
|
||||||
|
strcat(env, previous_env);
|
||||||
putenv(env);
|
putenv(env);
|
||||||
|
// fprintf(stdout, "LD_LIBRARY_PATH: %s\n", env);
|
||||||
// fprintf(stdout, "Current working dir: %s\n", cwd);
|
// fprintf(stdout, "Current working dir: %s\n", cwd);
|
||||||
} else
|
} else
|
||||||
perror("Unable to find current directory");
|
perror("Unable to find current directory");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user