From afccf2a4d19dcc24ead71c749e0e2ffb33c45666 Mon Sep 17 00:00:00 2001 From: "Pierre-Loup A. Griffais" Date: Mon, 14 Sep 2020 23:57:56 -0700 Subject: [PATCH] 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. --- src/steamcompmgr.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/steamcompmgr.cpp b/src/steamcompmgr.cpp index f288713..01583a0 100644 --- a/src/steamcompmgr.cpp +++ b/src/steamcompmgr.cpp @@ -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" );