Skip to content

Commit

Permalink
GameScope: change argument building logic
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sonic2kk committed Feb 16, 2023
1 parent fa39f9d commit eb897a4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions steamtinkerlaunch
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit eb897a4

Please sign in to comment.