fix processing of filenames containing spaces

This commit is contained in:
Dmitry Smirnov
2013-07-05 14:31:56 +10:00
parent da68f9bb9b
commit 0b6ea663eb

View File

@@ -81,7 +81,7 @@ vorbis()
(for field in $fields; do (for field in $fields; do
value="" value=""
for conv in $(eval echo \$$field); do for conv in $(eval echo \$$field); do
value=$($CUEPRINT -n $1 -t "$conv\n" $cue_file) value=$($CUEPRINT -n $1 -t "$conv\n" "$cue_file")
if [ -n "$value" ]; then if [ -n "$value" ]; then
echo "$field=$value" echo "$field=$value"
@@ -114,7 +114,7 @@ id3()
for field in $fields; do for field in $fields; do
value="" value=""
for conv in $(eval echo \$$field); do for conv in $(eval echo \$$field); do
value=$($CUEPRINT -n $1 -t "$conv\n" $cue_file) value=$($CUEPRINT -n $1 -t "$conv\n" "$cue_file")
if [ -n "$value" ]; then if [ -n "$value" ]; then
break break
@@ -159,14 +159,14 @@ main()
cue_file=$1 cue_file=$1
shift shift
ntrack=$(cueprint -d '%N' $cue_file) ntrack=$(cueprint -d '%N' "$cue_file")
trackno=1 trackno=1
if [ $# -ne $ntrack ]; then if [ $# -ne $ntrack ]; then
echo "warning: number of files does not match number of tracks" echo "warning: number of files does not match number of tracks"
fi fi
for file in $@; do for file in "$@"; do
case $file in case $file in
*.[Ff][Ll][Aa][Cc]) *.[Ff][Ll][Aa][Cc])
vorbis $trackno "$file" vorbis $trackno "$file"