Fix broken range code, patch from Charles Steinkuehler
authorColin Tuckley <colin@tuckley.org>
Sun, 26 Jul 2009 15:28:19 +0000 (15:28 +0000)
committerColin Tuckley <colin@tuckley.org>
Sun, 26 Jul 2009 15:28:19 +0000 (15:28 +0000)
abcde
debian/changelog

diff --git a/abcde b/abcde
index 1d0c446..6cb9600 100755 (executable)
--- a/abcde
+++ b/abcde
@@ -3291,14 +3291,17 @@ if [ "$ONETRACK" = "y" ]; then
 else
        while [ $# -gt 0 ]; do
                # Range parsing code courtesy of Vincent Ho
-               RSTART=$(echo $1 | cut -f1 -d-)
-               REND=$(echo $1 | cut -f2 -d-)
-               if [ "$RSTART" = "$REND" ]; then
-                       NEWTRACKS="$RSTART"
-               else
-                       NEWTRACKS=$(f_seq_line $RSTART $REND)
-               fi
-               TRACKQUEUE=$(echo "$TRACKQUEUE" "$NEWTRACKS")
+               # Cleaned up to use shell built-ins by Charles Steinkuehler
+               if [ "${1#*[^0-9-]}" != "$1" ]; then
+                       log error "syntax error while processing track numbers"
+               else
+                       RSTART=${1%%-*}
+                       REND=${1##*-}
+                       while [ ${RSTART:=1} -le ${REND:=0} ] ; do
+                               TRACKQUEUE="$TRACKQUEUE $RSTART"
+                               RSTART=$(( $RSTART + 1 ))
+                       done
+               fi
                shift
        done
 fi
index 9d3846c..06a2712 100644 (file)
@@ -5,8 +5,9 @@ abcde (2.3.99.8-1) unstable; urgency=low
   * Fix typos (Closes: #435605, #435606).
   * Fix misspelling of comma in script and manpage (Closes: #435603).
   * Fix Writable temp directories not owned/writeable (Closes: #143552).
+  * Fix broken range code, patch from Charles Steinkuehler (Closes: #389981).
 
- -- Colin Tuckley <colint@debian.org>  Sun, 26 Jul 2009 14:40:56 +0100
+ -- Colin Tuckley <colint@debian.org>  Sun, 26 Jul 2009 16:24:59 +0100
 
 abcde (2.3.99.7-1) unstable; urgency=low