mangohud bin: Don't append library multiple times in LD_PRELOAD

pull/1034/head
FlightlessMango 12 months ago
parent 0ae2e42fe7
commit f1b5ba34be

@ -15,8 +15,16 @@ if [ "$1" = "--dlsym" ]; then
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}"
# Make sure we don't append mangohud lib multiple times
# otherwise this could cause issues with steam runtime
case ":${LD_PRELOAD-}:" in
(*:$MANGOHUD_LIB_NAME:*)
;;
(*)
# 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}"
esac
exec env MANGOHUD=1 LD_PRELOAD="${LD_PRELOAD}" "$@"

Loading…
Cancel
Save