From eb897a437db5306b94936eee5b9f0f40588ca4fc Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Thu, 16 Feb 2023 18:23:36 +0000 Subject: [PATCH] GameScope: change argument building logic Previously we used 'mapfile', which we can't use now because some arguments may have spaces in their path. We use new logic now using readarray and some sed magic to break up the gamescope arguments and build each argument and its value separately. --- steamtinkerlaunch | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index 8093661f..d8b68a11 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -6,7 +6,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v12.12.20230217-1" +PROGVERS="v12.12.20230217-4" PROGCMD="${0##*/}" SHOSTL="stl" GHURL="https://github.com" @@ -17957,7 +17957,11 @@ function gameScopeArgs { unset GAMESCOPEARGSARR if [ "$1" != "$NON" ]; then - mapfile -d " " -t -O "${#GAMESCOPEARGSARR[@]}" GAMESCOPEARGSARR < <(printf '%s' "$ARGSTRING") + GSINARGS="$( echo "$ARGSTRING" | sed "s:--:\n--:g;s:\ -:\n-:g;s:\ ':\n':g" )" # Turn incoming GameScope arguments into newline + readarray GSINARR<<< "$GSINARGS" + for GSARG in "${GSINARR[@]}"; do + GAMESCOPEARGSARR+=("$( echo "$GSARG" | xargs )") + done fi if [ "${#GAMESCOPEARGSARR[@]}" -ge 1 ]; then