From e1279871f8eee42c0c91baf8e99459ec2b6a57de Mon Sep 17 00:00:00 2001 From: twojstaryzdomu Date: Tue, 14 Jun 2022 19:29:30 +0200 Subject: [PATCH] Do not replace tokens when empty --- scriptmodules/supplementary/runcommand/runcommand.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scriptmodules/supplementary/runcommand/runcommand.sh b/scriptmodules/supplementary/runcommand/runcommand.sh index 3d19d89659..4657e09f97 100755 --- a/scriptmodules/supplementary/runcommand/runcommand.sh +++ b/scriptmodules/supplementary/runcommand/runcommand.sh @@ -1176,8 +1176,8 @@ function get_sys_command() { COMMAND="$(default_emulator get emu_cmd)" # replace tokens - COMMAND="${COMMAND//\%ROM\%/\"$ROM\"}" - COMMAND="${COMMAND//\%BASENAME\%/\"$ROM_BN\"}" + COMMAND="${COMMAND//\%ROM\%/${ROM:+\"${ROM}\"}}" + COMMAND="${COMMAND//\%BASENAME\%/${ROM_BN:+\"${ROM_BN}\"}}" # special case to get the last 2 folders for quake games for the -game parameter # remove everything up to /quake/