Merge pull request #1598 from fewtarius/dev

Tweak get_setting for compatibility with wonky filenames.
This commit is contained in:
fewtarius 2023-06-18 09:30:11 -04:00 committed by GitHub
commit 305286470e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,7 +16,7 @@ get_setting() {
if [ ! -z "${3}" ] if [ ! -z "${3}" ]
then then
### Test to see if we have a game setting. ### Test to see if we have a game setting.
VAR="$2\[\"$(echo ${3} | sed 's/[\(\)]/\\&/g')\"\]\.$1" VAR="$2\[\"$(echo ${3} | sed 's/\W/\\&/g')\"]\.$1"
OUTPUT=$(awk 'BEGIN {FS="="} /^'"${VAR}"'/ {print $NF}' ${J_CONF}) OUTPUT=$(awk 'BEGIN {FS="="} /^'"${VAR}"'/ {print $NF}' ${J_CONF})
if [ ! -z "${OUTPUT}" ] if [ ! -z "${OUTPUT}" ]
then then