From df909421f6bedac630aa522142cbd1ba681ffd60 Mon Sep 17 00:00:00 2001 From: Aldinas Date: Tue, 13 Feb 2024 20:50:52 +0000 Subject: [PATCH] Allow whitespaces in steam account names. Allows legacy steam account names that could contain white spaces to be correctly parsed by the system. --- NonSteamLaunchers.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/NonSteamLaunchers.sh b/NonSteamLaunchers.sh index 4a6e627..b9e643f 100755 --- a/NonSteamLaunchers.sh +++ b/NonSteamLaunchers.sh @@ -2579,12 +2579,14 @@ if [[ -f "${logged_in_home}/.steam/root/config/loginusers.vdf" ]]; then current_steamid="" # Process each user block - while read steamid account timestamp; do + # Set IFS to only look for Commas to avoid issues with Whitespace in older account names. + while IFS="," read steamid account timestamp; do if (( timestamp > max_timestamp )); then max_timestamp=$timestamp current_user=$account current_steamid=$steamid fi + # Output our discovered values as comma seperated string to be read into the IDs. done < <(echo "$most_recent_user" | awk -v RS='}\n' -F'\n' ' { for(i=1;i<=NF;i++){ @@ -2598,7 +2600,7 @@ if [[ -f "${logged_in_home}/.steam/root/config/loginusers.vdf" ]]; then split($i,c, "\""); timestamp=c[4]; } } - print steamid, account, timestamp + print steamid "," account "," timestamp }') # Print the currently logged in user