Doh! Silly thinko bug
authorSteve McIntyre <steve@einval.com>
Sat, 3 Mar 2018 17:21:40 +0000 (17:21 +0000)
committerSteve McIntyre <steve@einval.com>
Sat, 3 Mar 2018 17:21:40 +0000 (17:21 +0000)
Use *expr*, not *eval* for unpadding

abcde

diff --git a/abcde b/abcde
index 691c18f..9c88127 100755 (executable)
--- a/abcde
+++ b/abcde
@@ -553,7 +553,7 @@ do_replaygain()
                        REPLAYINDEX=0
                        for UTRACKNUM in $TRACKQUEUE
                        do
-                               CDDBTRACKNUM=$(eval "$UTRACKNUM" - 1) # Unpad
+                               CDDBTRACKNUM=$(expr "$UTRACKNUM" - 1) # Unpad
                                getcddbinfo TRACKNAME
                                splitvarious
                                TRACKFILE="$(mungetrackname "$TRACKNAME")"
@@ -1832,7 +1832,7 @@ do_playlist ()
                        for UTRACKNUM in $TRACKQUEUE
                        do
                                # Shares some code with do_move since the filenames have to match
-                               CDDBTRACKNUM=$(eval $UTRACKNUM - 1) # Unpad
+                               CDDBTRACKNUM=$(expr $UTRACKNUM - 1) # Unpad
                                getcddbinfo TRACKNAME
                                splitvarious
                                TRACKFILE="$(mungetrackname "$TRACKNAME")"
@@ -3469,7 +3469,7 @@ do_cdread ()
        else
                UTRACKNUM=$1
        fi
-       CDDBTRACKNUM=$(eval $UTRACKNUM - 1) # Unpad
+       CDDBTRACKNUM=$(expr $UTRACKNUM - 1) # Unpad
        if [ "$USEPIPES" = "y" ]; then
                TEMPARG="PIPERIPPER_$CDROMREADERSYNTAX"
                FILEARG="$( eval echo "\$$TEMPARG" )"
@@ -3501,7 +3501,7 @@ do_cdread ()
                ### FIXME ### Shall we just use -o $FILEARG ??
                flac)
                        # Avoid problems with math expressions by unpadding the given UTRACKNUM
-                       STRIPTRACKNUM=$(eval $UTRACKNUM + 0 )
+                       STRIPTRACKNUM=$(expr $UTRACKNUM + 0 )
                        nice $READNICE $FLAC -d -f --cue="${READTRACKNUMS:-$STRIPTRACKNUM.1-$(($STRIPTRACKNUM + 1)).0}" "$FILEARG" "$CDROM" ;;
                cdparanoia|libcdio)
                        if [ "$USEPIPES" = "y" ]; then
@@ -3546,7 +3546,7 @@ do_cdread ()
                ;;
                cddafs)
                        # Find the track's mounted path
-                       REALTRACKNUM=$(eval $UTRACKNUM + 0) # Unpad
+                       REALTRACKNUM=$(expr $UTRACKNUM + 0) # Unpad
                        FILEPATH=$(mount | grep "$CDROM on" | sed 's/^[^ ]* on \(.*\) (.*/\1/')
                        FILEPATH=$(find "$FILEPATH" | grep "/$REALTRACKNUM ");
                        # If the file exists, copy it
@@ -5408,7 +5408,7 @@ do
                        splitvarious
                else
                        TRACKNUM="$UTRACKNUM"
-                       CDDBTRACKNUM=$(eval $UTRACKNUM - 1) # Unpad
+                       CDDBTRACKNUM=$(expr $UTRACKNUM - 1) # Unpad
                        getcddbinfo TRACKNAME
                        splitvarious
                fi