From 8c531b483348d3475b75491485bffbee1d633fc6 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Sun, 12 Mar 2023 14:11:38 +0000 Subject: [PATCH] mangohud: simplify variable handling Signed-off-by: Emil Velikov --- bin/mangohud.in | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/bin/mangohud.in b/bin/mangohud.in index a0776b96..f9752249 100755 --- a/bin/mangohud.in +++ b/bin/mangohud.in @@ -8,19 +8,16 @@ if [ "$#" -eq 0 ]; then exit 1 fi -if [ "$1" = "--dlsym" ]; then - MANGOHUD_DLSYM=1 - shift -fi - MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud.so" -if [ "$MANGOHUD_DLSYM" = "1" ]; then +if [ "$1" = "--dlsym" ]; then + MANGOHUD_DLSYM=1 MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}" + shift fi # Preload using the plain filenames of the libs, the dynamic linker will # figure out whether the 32 or 64 bit version should be used -LD_PRELOAD="${LD_PRELOAD}${LD_PRELOAD:+:}${MANGOHUD_LIB_NAME}" +LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}${MANGOHUD_LIB_NAME}" exec env MANGOHUD=1 LD_PRELOAD="${LD_PRELOAD}" "$@"