Extend Musicbrainz multi-artist support
[abcde.git] / abcde
diff --git a/abcde b/abcde
index 9c88127..384954a 100755 (executable)
--- a/abcde
+++ b/abcde
@@ -144,7 +144,7 @@ get_last()
                        last=$stdin
                done
        else
-               for last in "$@" ; do :; done
+               for last in $@ ; do :; done
        fi
        echo "$last"
 }
@@ -2064,7 +2064,7 @@ do_discid ()
                                                        TRACKS=${#OFFSETTIMES[@]}
                                                        unset OFFSETS
                                                        #echo "processing offsetimes ${OFFSETTIMES[@]}"
-                                                       for OFFSETTIME in "${OFFSETTIMES[@]}"; do
+                                                       for OFFSETTIME in ${OFFSETTIMES[@]}; do
                                                                OFFSETS="$OFFSETS $(( 10#${OFFSETTIME:0:2} * 4500 + 10#${OFFSETTIME:3:2} * 75 + 10#${OFFSETTIME:6:2} ))"
                                                                #OFFSETS[${#OFFSETS[*]}]=$(( 10#${OFFSETTIME:0:2} * 4500 + 10#${OFFSETTIME:3:2} * 75 + 10#${OFFSETTIME:6:2} ))
                                                        done
@@ -3451,7 +3451,7 @@ do_cdread ()
                # the user said
                # We need the first and last track for cdda2wav/icedax
                FIRSTTRACK=$2
-               LASTTRACK=$(($3 + 0))
+               LASTTRACK=$(expr $3 + 0)
                UTRACKNUM=$FIRSTTRACK
                case "$CDROMREADERSYNTAX" in
                        flac) READTRACKNUMS="-" ;;
@@ -4079,7 +4079,7 @@ case "$EXTRAVERBOSE" in
 esac
 
 # Parse command line options
-while getopts 1a:bBc:C:d:DefgGhj:klLmMnNo:pP:Q:r:s:S:t:T:UvVxX:w:W:z opt ; do
+while getopts 1a:bBc:C:d:DefgGhj:klLmMnNo:pPQ:r:s:S:t:T:UvVxX:w:W:z opt ; do
        case "$opt" in
                1) ONETRACK=y ;;
                a) ACTIONS="$OPTARG" ;;
@@ -5190,14 +5190,14 @@ if [ "$LOWDISK" = "y" ] || [ "$ONETRACK" = "y" ]; then
 fi
 
 if [ "$ONETRACK" = "y" ]; then
-       TRACKS="$FIRSTTRACK"
+       TRACKS=$FIRSTTRACK
        if [ "$USEPIPES" = "y" ]; then
                if checkstatus "readencodetrack-$FIRSTTRACK"; then :; else
-                       do_cdread onetrack "$FIRSTTRACK" "$LASTTRACK" | do_encode "$FIRSTTRACK" %local0% > /dev/null 2>&1
+                       do_cdread onetrack $FIRSTTRACK $LASTTRACK | do_encode $FIRSTTRACK %local0% > /dev/null 2>&1
                fi
        else
                if checkstatus "readtrack-$FIRSTTRACK"; then :; else
-                       do_cdread onetrack "$FIRSTTRACK" "$LASTTRACK"
+                       do_cdread onetrack $FIRSTTRACK $LASTTRACK
                fi
        fi
 else
@@ -5207,11 +5207,11 @@ else
                        if [ "$USEPIPES" = "y" ]; then
                                if checkstatus "readencodetrack-$UTRACKNUM"; then :; else
                                        # Read, pipe, shut up!
-                                       do_cdread "$UTRACKNUM" | do_encode "$UTRACKNUM" %local0% > /dev/null 2>&1
+                                       do_cdread $UTRACKNUM | do_encode $UTRACKNUM %local0% > /dev/null 2>&1
                                fi
                        else
                                if checkstatus "readtrack-$UTRACKNUM"; then :; else
-                                       do_cdread "$UTRACKNUM"
+                                       do_cdread $UTRACKNUM
                                fi
                                if [ "$?" != "0" ]; then
                                        # CD read failed - don't give the goahead to