From 5e160325ab69db8dd234248898d2d1e4d0b1bb86 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Wed, 18 Sep 2024 15:35:56 +0900 Subject: [PATCH] RUN_GAME: escaping ' --- functions/run_game.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/functions/run_game.sh b/functions/run_game.sh index 8f084a05..27315fea 100755 --- a/functions/run_game.sh +++ b/functions/run_game.sh @@ -168,6 +168,7 @@ find_system_commands() { substitute_placeholders() { local cmd="$1" log d "Substitute placeholder: working on $cmd" + game=$(echo "$game" | sed "s/'/'\\\\''/g") # escaping internal ' local rom_path="$game" local rom_dir=$(dirname "$rom_path") @@ -193,6 +194,8 @@ substitute_placeholders() { cmd="${cmd//"%FILENAME%"/"'$file_name'"}" cmd="${cmd//"%ROMRAW%"/"'$rom_raw'"}" cmd="${cmd//"%ROMPATH%"/"'$rom_dir'"}" + cmd="${cmd//"%ENABLESHORTCUTS%"/""}" + cmd="${cmd//"%EMULATOR_OS-SHELL%"/"/bin/sh"}" # Ensure paths are quoted correctly cmd="${cmd//"%ROM%"/"'$rom_path'"}"