diff --git a/main/source/window/linux_window.cpp b/main/source/window/linux_window.cpp index b7285c42d..58f9b63b2 100644 --- a/main/source/window/linux_window.cpp +++ b/main/source/window/linux_window.cpp @@ -21,7 +21,7 @@ namespace hex { // Add plugin library folders to dll search path for (const auto &path : hex::fs::getDefaultPaths(fs::ImHexPath::Libraries)) { if (std::fs::exists(path)) - putenv(hex::format("LD_LIBRARY_PATH={}", path.c_str()).c_str()); + setenv("LD_LIBRARY_PATH", hex::format("{};{}", hex::getEnvironmentVariable("LD_LIBRARY_PATH").value_or(""), path.string().c_str()).c_str(), true); } if (!isatty(STDOUT_FILENO)) { diff --git a/main/source/window/macos_window.cpp b/main/source/window/macos_window.cpp index 455acffff..ea3d9c57d 100644 --- a/main/source/window/macos_window.cpp +++ b/main/source/window/macos_window.cpp @@ -20,7 +20,7 @@ namespace hex { // Add plugin library folders to dll search path for (const auto &path : hex::fs::getDefaultPaths(fs::ImHexPath::Libraries)) { if (std::fs::exists(path)) - putenv(hex::format("LD_LIBRARY_PATH={}", path.c_str()).c_str()); + setenv("LD_LIBRARY_PATH", hex::format("{};{}", hex::getEnvironmentVariable("LD_LIBRARY_PATH").value_or(""), path.string().c_str()).c_str(), true); } if (!isatty(STDOUT_FILENO)) {