steamcompmgr: still affect LD_PRELOAD if we strip everything from it

In cases where LD_PRELOAD only contained things we wanted to strip, we
weren't actually setting the result and stripping nothing.
This commit is contained in:
Pierre-Loup A. Griffais 2020-09-14 23:57:56 -07:00
parent cdfe50d53b
commit afccf2a4d1

View file

@ -2810,10 +2810,17 @@ steamcompmgr_main (int argc, char **argv)
nice( g_nOldNice - g_nNewNice );
}
// Set modified LD_PRELOAD
if ( strNewPreload.empty() == false )
// Set modified LD_PRELOAD if needed
if ( pchCurrentPreload != nullptr )
{
setenv( "LD_PRELOAD", strNewPreload.c_str(), 1 );
if ( strNewPreload.empty() == false )
{
setenv( "LD_PRELOAD", strNewPreload.c_str(), 1 );
}
else
{
unsetenv( "LD_PRELOAD" );
}
}
unsetenv( "ENABLE_VKBASALT" );