Skip to content

Commit

Permalink
updateConfigEntry: Move declaration for ESCAPED_CFGVALUE
Browse files Browse the repository at this point in the history
Need to move it until after we map CFGVALUE booleans
so that ESCAPED_CFGVALUE contains the final updated
CFGVALUE.
  • Loading branch information
sonic2kk committed Mar 24, 2024
1 parent bba7e90 commit 075396d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions steamtinkerlaunch
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
PREFIX="/usr"
PROGNAME="SteamTinkerLaunch"
NICEPROGNAME="Steam Tinker Launch"
PROGVERS="v14.0.20240324-1 (updateConfigEntry-escpae-incoming-cfgvalue)"
PROGVERS="v14.0.20240324-2 (updateConfigEntry-escpae-incoming-cfgvalue)"
PROGCMD="${0##*/}"
PROGINTERNALPROTNAME="Proton-stl"
SHOSTL="stl"
@@ -10896,7 +10896,6 @@ function createDefaultCfgs {
function updateConfigEntry {
CFGCAT="$1"
CFGVALUE="$2"
ESCAPED_CFGVALUE="$( printf "%s" "$CFGVALUE" | sed 's/\\/\\\\/g' )" # Help prevent expanding incoming config values by escaping them (i.e. when using with sed)
CFGFILE="$3"

if [ "$CFGCAT" == "CUSTOMCMD" ] && [ "$CFGFILE" == "$STLDEFGAMECFG" ]; then
@@ -10921,6 +10920,9 @@ function updateConfigEntry {
CFGVALUE=""
fi

# Help prevent expanding incoming config values by escaping them (i.e. when using with sed)
ESCAPED_CFGVALUE="$( printf "%s\n" "$CFGVALUE" | sed 's/\\/\\\\/g' )"

# only save value if it changed
# sed needs escaped string because otherwise it'll expand escape sequences in strings with backslashes
# i.e. config values with Windows paths, '\home\test' will have '\t' expanded as a tab character

0 comments on commit 075396d

Please sign in to comment.