From 6526d40c68fd45f0da985ffd210f863a0646cd64 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Tue, 20 May 2025 17:51:20 -0400 Subject: [PATCH] Fixed create_game_array function. --- audiogame-manager.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index 88dc76e..0274ff8 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -278,10 +278,13 @@ process_launcher-flags() { create_game_array() { # Game array 0 bottle, 1 path, 2 title, 3+ flags + game="$1" for i in "${lines[@]}" ; do - # Escape pipe characters in both strings for regex matching - if [[ "${i//|/\\|}" =~ ^${game//|/\\|}$ ]]; then - game="$i" + # Only compare the launcher section + j="${game#*|}" + k="${i#*|}" + k="${k%%|*}" + if [[ "$j" == "$k" ]]; then IFS='|' read -ra game <<< "$i" break fi @@ -330,9 +333,9 @@ game_launcher() { source .includes/help.sh # Make available in this function documentation "$game" "$(echo "$game" | cut -d '|' -f2)" fi - create_game_array + create_game_array "$game" else - create_game_array + create_game_array "$game" if [[ -z "$game" ]]; then echo "Game $1 not found." exit 1