From 9c9eee5d01c9983d7d4b43c9fd7ada5727e25bd6 Mon Sep 17 00:00:00 2001 From: Themaister Date: Tue, 31 May 2011 14:29:32 +0200 Subject: [PATCH] Should fix zip loading of [!] files... --- ssnes-zip | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ssnes-zip b/ssnes-zip index b1e78b18b9..d3beba8bc2 100755 --- a/ssnes-zip +++ b/ssnes-zip @@ -31,7 +31,10 @@ extract_zip() die "Cannot find .smc nor .sfc file in archive" fi - unzip -p "$1" "$FILENAME" > "$TMPROM" + # The people who made the [!] naming convention obviously have never used regex ... <_< + FILENAME_FIXED="`echo $FILENAME | sed -e 's|\[|\\\\[|g' -e 's|!|\\\\!|g' -e 's|\]|\\\\]|g'`" + + unzip -p "$1" "$FILENAME_FIXED" > "$TMPROM" } extract_7z() @@ -79,13 +82,14 @@ esac SAVENAME="`basename \"$COMP_FILE\" $EXTENSION`" DIRNAME="`dirname \"$COMP_FILE\"`" SAVENAME="${SAVENAME}.srm" -echo "Savename: ${DIRNAME}/${SAVENAME}" SSNES_PATH="`which ssnes`" if [ -z "$SSNES_PATH" ]; then die "Cannot find SSNES in path." fi +echo "Temp ROM: $TMPROM" +echo "Savename: ${DIRNAME}/${SAVENAME}" "$SSNES_PATH" "$TMPROM" -s "${DIRNAME}/${SAVENAME}" "$@" rm "$TMPROM" rm -r "$TMPDIR"