More fixups of track number padding
authorSteve McIntyre <steve@einval.com>
Thu, 2 Aug 2018 14:46:48 +0000 (15:46 +0100)
committerSteve McIntyre <steve@einval.com>
Thu, 2 Aug 2018 14:46:48 +0000 (15:46 +0100)
Thanks to John Straw for the patch

abcde
changelog

diff --git a/abcde b/abcde
index 6c90a27..6875bdc 100755 (executable)
--- a/abcde
+++ b/abcde
@@ -463,7 +463,8 @@ gettracknum()
        if [ -n "$STARTTRACKNUMBER" ] ; then
                # Get the trackpadding from the current track, also trim whitespace for MacOSX
                CURRENTTRACKPADDING=$(echo -n "$UTRACKNUM" | wc -c | tr -d ' ')
-               TRACKNUM=$( printf %0.${CURRENTTRACKPADDING}d $((${UTRACKNUM} + ${STARTTRACKNUMBER} - ${FIRSTTRACK})))
+               REALTRACKNUM=$(expr $UTRACKNUM + 0) # Unpad
+               TRACKNUM=$( printf %0.${CURRENTTRACKPADDING}d $((${REALTRACKNUM} + ${STARTTRACKNUMBER} - ${FIRSTTRACK})))
        else
                TRACKNUM=${UTRACKNUM}
        fi
index d9b4501..2a87ceb 100644 (file)
--- a/changelog
+++ b/changelog
@@ -7,6 +7,8 @@ abcde 2.9.2
    https://abcde.einval.com/bugzilla/show_bug.cgi?id=50
  * Add a link to the CDDB data format in the abcde man page. Closes
    Issue 81: https://abcde.einval.com/bugzilla/show_bug.cgi?id=81
+ * More fixups of track number padding. Thanks to John Straw for the
+   patch.
 
 abcde 2.9.1