Skip to content

Commit

Permalink
Fix running plugin under Ardour (need to skip LD_* env)
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed May 28, 2024
1 parent 32d753f commit f934f47
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/plugin/WebViewX11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,20 @@ void* addWebView(const uintptr_t parentWinId, const double scaleFactor, const ui

char** const envp = new char*[envsize + 5];

for (uint i = 0; i < envsize; ++i)
envp[i] = strdup(environ[i]);
{
uint i = 0;
for (uint j = 0; j < envsize; ++j)
{
if (std::strncmp(environ[j], "LD_LIBRARY_PATH=", 16) == 0)
continue;
if (std::strncmp(environ[j], "LD_PRELOAD=", 11) == 0)
continue;
envp[i++] = strdup(environ[j]);
}

for (uint i = 0; i < 5; ++i)
envp[envsize + i] = nullptr;
for (; i < envsize + 5; ++i)
envp[i] = nullptr;
}

set_envp_value(envp, "LANG=en_US.UTF-8");
set_envp_value(envp, "DPF_WEBVIEW_PORT", String(port));
Expand Down

0 comments on commit f934f47

Please sign in to comment.