From 6b9393f949af1f9d4bb8e69b7b175e8251fe799c Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 30 Aug 2023 22:58:02 +0100 Subject: [PATCH] fix: improve sed command in fn_info_game_valve_keyvalues (#4300) The sed command in the fn_info_game_valve_keyvalues function has been modified to improve its functionality. The change ensures that only the value between double quotes is captured, even if there are additional spaces before or after the value. This enhances the accuracy of extracting values from server configuration files. --- lgsm/modules/info_game.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 2bfdc10e7..5eea7dfba 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -157,7 +157,7 @@ fn_info_game_valve_keyvalues() { else servercfgparse="${servercfgfullpath}" fi - eval "${1}=\"$(sed -n '/^\<'"${2}"'\>/ { s/.* *"\?\([^"]*\)"\?/\1/p;q }' "${servercfgparse}" | tr -d '\r')\"" + eval "${1}=\"$(sed -n '/^\<'"${2}"'\>/ { s/.* *"\([^"]*\)".*/\1/p;q }' "${servercfgparse}" | tr -d '\r')\"" configtype="valve_keyvalues" }