Skip to content

Commit 4b5f20f

Browse files
committed
Clean up emulationstation configscripts to use a consistent sanitize implementation for filenames that include the device name
Previously, certain characters were unnecessarily escaped when placed within range expressions. This change aligns the sanitizing code with reicast.
1 parent d24b456 commit 4b5f20f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

scriptmodules/supplementary/emulationstation/configscripts/openmsx.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ function onend_openmsx_joystick() {
150150
local conf
151151

152152
# sanitize filename
153-
conf=${DEVICE_NAME//[\?\<\>\\\/:\*\|]/}
153+
conf=${DEVICE_NAME//[:><?\"\/\\|*]/}
154154

155155
mkdir -p "$home/.openMSX/share/joystick/game"
156156
cat > "$home/.openMSX/share/joystick/${conf}.tcl" <<_EOF_

scriptmodules/supplementary/emulationstation/configscripts/retroarch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ function onend_retroarch_joystick() {
387387
done < <(grep -Fl "\"$DEVICE_NAME\"" "$dir/"*.cfg 2>/dev/null)
388388

389389
# sanitise filename
390-
file="${DEVICE_NAME//[\?\<\>\\\/:\*\|]/}.cfg"
390+
file="${DEVICE_NAME//[:><?\"\/\\|*]/}.cfg"
391391

392392
if [[ -f "$dir/$file" ]]; then
393393
mv "$dir/$file" "$dir/$file.bak"

0 commit comments

Comments
 (0)