From ac79fffcc5c05a5872dc884395e8ed68d75ad6c4 Mon Sep 17 00:00:00 2001 From: cmitu <31816814+cmitu@users.noreply.github.com> Date: Mon, 20 Jun 2022 16:34:17 +0100 Subject: [PATCH] runcommand: remove spurious space from `libretro_directory` Fix the extra spaces added in the value of `libretro_directory`,caused by the `grep` pattern in 553c4fef. The extra space at the beginning crashes RetroArch when trying to initiate a netplay connection (as a client), see https://github.com/RetroPie/RetroPie-Setup/issues/3161#issuecomment-1160146932. --- scriptmodules/supplementary/runcommand/runcommand.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scriptmodules/supplementary/runcommand/runcommand.sh b/scriptmodules/supplementary/runcommand/runcommand.sh index 3d9fe45d13..2b7a72b373 100755 --- a/scriptmodules/supplementary/runcommand/runcommand.sh +++ b/scriptmodules/supplementary/runcommand/runcommand.sh @@ -1103,7 +1103,7 @@ function retroarch_append_config() { fi # set `libretro_directory` to the core parent folder - local core_dir=$(echo "$COMMAND" | grep -Eo " $ROOTDIR/libretrocores/.*libretro\.so " | head -n 1) + local core_dir=$(echo "$COMMAND" | grep -Eo "$ROOTDIR/libretrocores/.*libretro\.so" | head -n 1) core_dir=$(dirname "$core_dir") [[ -n "$core_dir" ]] && iniSet "libretro_directory" "$core_dir"