Skip to content

Commit ff83118

Browse files
committed
quote rom names with single quotes
Signed-off-by: Michel-FK <[email protected]>
1 parent bfed994 commit ff83118

File tree

1 file changed

+8
-4
lines changed
  • FunKey/board/funkey/rootfs-overlay/usr/local/sbin

1 file changed

+8
-4
lines changed

FunKey/board/funkey/rootfs-overlay/usr/local/sbin/instant_play

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,15 @@ save)
6060

6161
# Write quick load file args
6262
echo -n "" > "${INSTANT_PLAY_FILE}"
63-
for arg in "$@"; do
64-
65-
# Add quotes around all arguments
66-
echo -n "'${arg}' " >> "${INSTANT_PLAY_FILE}"
63+
while :
64+
do
65+
printf "'" >> "${INSTANT_PLAY_FILE}"
66+
printf %s "$1" | sed "s/'/'\\\\''/g" >> "${INSTANT_PLAY_FILE}"
67+
shift
68+
case $# in 0) break; esac
69+
printf "' " >> "${INSTANT_PLAY_FILE}"
6770
done
71+
printf "'\n" >> "${INSTANT_PLAY_FILE}"
6872

6973
# Add the magic sauce to launch the process in background,
7074
# record the PID into a file, wait for the process to

0 commit comments

Comments
 (0)