From 31d63255b0380b336b8284d80517c84fe1d5b799 Mon Sep 17 00:00:00 2001 From: jackun Date: Wed, 13 Jul 2022 19:05:01 +0300 Subject: [PATCH] Append colon only if LD_* env vars are set --- bin/mangohud.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/mangohud.in b/bin/mangohud.in index 8ec21de9..e13da99d 100755 --- a/bin/mangohud.in +++ b/bin/mangohud.in @@ -22,7 +22,7 @@ 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, and will search # for it in the correct directory -LD_PRELOAD="${LD_PRELOAD}:${MANGOHUD_LIB_NAME}" -LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:@ld_libdir_mangohud@" +LD_PRELOAD="${LD_PRELOAD}${LD_PRELOAD:+:}${MANGOHUD_LIB_NAME}" +LD_LIBRARY_PATH="${LD_LIBRARY_PATH}${LD_LIBRARY_PATH:+:}@ld_libdir_mangohud@" exec env MANGOHUD=1 LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" LD_PRELOAD="${LD_PRELOAD}" "$@"