Explorar o código

Clean up file paths

Zachary Kotlarek %!s(int64=12) %!d(string=hai) anos
pai
achega
d07cc5e186
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      discToMkv.sh

+ 3 - 0
discToMkv.sh

@@ -70,6 +70,9 @@ if [ -z "${NAME}" ]; then
 	exit 1
 fi
 
+# Ensure the name is filesystem-safe
+NAME="`echo "${NAME}" | sed 's%[^a-zA-Z0-9_\-\ ,;\.!@#$\%\^&\*()=\+\?]%_%'`"
+
 # Create the output directory
 if [ ! -d "${OUT_DIR}/${NAME}" ]; then
 	mkdir "${OUT_DIR}/${NAME}"