cuetag: Fix handling of spaces in file names

Fixes #14
This commit is contained in:
Svend Sorensen
2013-11-23 17:23:01 -08:00
parent bbc385474f
commit 21ee6cc40f

View File

@@ -182,16 +182,15 @@ main()
ntrack=$(cueprint -d '%N' "$cue_file")
trackno=1
FILES= FIELDS=
NUM_FILES=0 FIELDS=
for arg in "$@"; do
case "$arg" in
*.*) FILES="$FILES $arg";;
*.*) NUM_FILES=$(expr $NUM_FILES + 1);;
*) FIELDS="$FIELDS $arg";;
esac
done
set -- $FILES
if [ $# -ne $ntrack ]; then
if [ $NUM_FILES -ne $ntrack ]; then
echo "warning: number of files does not match number of tracks"
fi
@@ -209,7 +208,7 @@ main()
*.[Tt][Xx][Tt])
vorbis $trackno "$file"
;;
*)
*.*)
echo "$file: uknown file type"
;;
esac