Use system LD_LIBRARY_PATH when opening web browser
This commit is contained in:
parent
ca0636ed03
commit
88c2ce7ee5
@ -47,10 +47,31 @@ namespace Online
|
|||||||
}
|
}
|
||||||
#elif defined(__linux__) && !defined(__ANDROID__)
|
#elif defined(__linux__) && !defined(__ANDROID__)
|
||||||
std::string command = std::string("xdg-open ").append(url);
|
std::string command = std::string("xdg-open ").append(url);
|
||||||
|
|
||||||
|
const char* lib_path = getenv("LD_LIBRARY_PATH");
|
||||||
|
const char* system_lib_path = getenv("SYSTEM_LD_LIBRARY_PATH");
|
||||||
|
|
||||||
|
if (system_lib_path != NULL)
|
||||||
|
{
|
||||||
|
setenv("LD_LIBRARY_PATH", system_lib_path, 1);
|
||||||
|
}
|
||||||
|
|
||||||
if (system(command.c_str()))
|
if (system(command.c_str()))
|
||||||
{
|
{
|
||||||
Log::error("OpenURL", "Command returned non-zero exit status");
|
Log::error("OpenURL", "Command returned non-zero exit status");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (system_lib_path != NULL)
|
||||||
|
{
|
||||||
|
if (lib_path != NULL)
|
||||||
|
{
|
||||||
|
setenv("LD_LIBRARY_PATH", lib_path, 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unsetenv("LD_LIBRARY_PATH");
|
||||||
|
}
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
Log::error("OpenURL", "Not implemented for this platform!");
|
Log::error("OpenURL", "Not implemented for this platform!");
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user