Removal of some problematic whitespace generated on MacOSX.
authorAndrew David Strong <andrew.david.strong@gmail.com>
Mon, 15 Apr 2013 02:28:15 +0000 (02:28 +0000)
committerAndrew David Strong <andrew.david.strong@gmail.com>
Mon, 15 Apr 2013 02:28:15 +0000 (02:28 +0000)
Thanks to richardjamespearce for the report and patch.
Closes issue 81.

abcde

diff --git a/abcde b/abcde
index dd56fc2..ababbd3 100755 (executable)
--- a/abcde
+++ b/abcde
@@ -433,8 +433,8 @@ getcddbinfo()
 gettracknum()
 {
        if [ -n "$STARTTRACKNUMBER" ] ; then
 gettracknum()
 {
        if [ -n "$STARTTRACKNUMBER" ] ; then
-               # Get the trackpadding from the current track
-               CURRENTTRACKPADDING=$(echo -n $UTRACKNUM | wc -c)
+               # 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 $(expr ${UTRACKNUM} + ${STARTTRACKNUMBER} - $FIRSTTRACK ))
        else
                TRACKNUM=${UTRACKNUM}
                TRACKNUM=$( printf %0.${CURRENTTRACKPADDING}d $(expr ${UTRACKNUM} + ${STARTTRACKNUMBER} - $FIRSTTRACK ))
        else
                TRACKNUM=${UTRACKNUM}