Fix LD_PRELOAD

This commit is contained in:
TheBrokenRail 2022-04-13 20:59:47 -04:00
parent 8f49c550ba
commit 5467b5178f

View File

@ -277,6 +277,14 @@ void bootstrap(int argc, char *argv[]) {
PRESERVE_ENVIRONMENTAL_VARIABLE("LD_PRELOAD");
char *new_ld_preload = NULL;
// Add LD_PRELOAD
{
char *value = get_env_safe("LD_PRELOAD");
if (strlen(value) > 0) {
string_append(&new_ld_preload, ":%s", value);
}
}
// ~/.minecraft-pi/mods
{
// Get Mods Folder
@ -299,14 +307,6 @@ void bootstrap(int argc, char *argv[]) {
free(mods_folder);
}
// Add LD_PRELOAD
{
char *value = get_env_safe("LD_PRELOAD");
if (strlen(value) > 0) {
string_append(&new_ld_preload, ":%s", value);
}
}
// Set LD_PRELOAD
set_and_print_env("LD_PRELOAD", new_ld_preload);
free(new_ld_preload);