e201ec4
diff -pruN 2.3.99.6-1/abcde 2.3.99.6-1ubuntu2/abcde
e201ec4
--- 2.3.99.6-1/abcde	2006-08-05 20:14:00.000000000 +0100
e201ec4
+++ 2.3.99.6-1ubuntu2/abcde	2007-10-18 16:24:45.000000000 +0100
e201ec4
@@ -1070,8 +1070,8 @@ do_encode ()
e201ec4
 					esac	
e201ec4
 					COMMENT="--comment \"$COMMENT\""
e201ec4
 				fi
e201ec4
-				# Quick hack to avoid tagging Ogg/Speex, since there is no other way to tag than inline tagging
e201ec4
-				if [ ! "$DOTAG" = "y" ]; then
e201ec4
+				# Tag the file at encode time, as it can't be done after encoding.
e201ec4
+				if [ "$DOTAG" = "y" ]; then
e201ec4
 					$RUN_COMMAND nice $EFFECTIVE_NICE $SPEEXENCODER $SPEEXENCODEROPTS --author "$TRACKARTIST" --title "$TRACKNAME" "$COMMENT" "$IN" "$OUT"
e201ec4
 				else
e201ec4
 					$RUN_COMMAND nice $EFFECTIVE_NICE $SPEEXENCODER $SPEEXENCODEROPTS "$IN" "$OUT"
e201ec4
@@ -1087,8 +1087,8 @@ do_encode ()
e201ec4
 				$RUN_COMMAND nice $EFFECTIVE_NICE $MPPENCODER $MPPENCODEROPTS --artist "$TRACKARTIST" --album "$DALBUM" --title "$TRACKNAME" --track "$1" --genre "$CDGENRE" --year "$CDYEAR" --comment "$COMMENT" "$IN" "$OUT"
e201ec4
 				;;
e201ec4
 			m4a)
e201ec4
-				# Quick hack to avoid tagging Ogg/Speex, since there is no other way to tag than inline tagging
e201ec4
-				if [ ! "$DOTAG" = "y" ]; then
e201ec4
+				# Tag the file at encode time, as it can't be done after encoding.
e201ec4
+				if [ "$DOTAG" = "y" ]; then
e201ec4
 					$RUN_COMMAND nice $EFFECTIVE_NICE $AACENCODER $AACENCODEROPTS --artist "$TRACKARTIST" --album "$DALBUM" --title "$TRACKNAME" --track "$1" --genre "$CDGENRE" --year "$CDYEAR" --comment "$COMMENT" -o "$OUT" "$IN"
e201ec4
 					
e201ec4
 				else
e201ec4
@@ -3221,14 +3221,17 @@ if [ "$ONETRACK" = "y" ]; then 
e201ec4
 else
e201ec4
 	while [ $# -gt 0 ]; do
e201ec4
 		# Range parsing code courtesy of Vincent Ho
e201ec4
-		RSTART=$(echo $1 | cut -f1 -d-)
e201ec4
-		REND=$(echo $1 | cut -f2 -d-)
e201ec4
-		if [ "$RSTART" = "$REND" ]; then
e201ec4
-			NEWTRACKS="$RSTART"
e201ec4
+		# Cleaned up to use shell built-ins by Charles Steinkuehler
e201ec4
+		if [ "${1#*[^0-9-]}" != "$1" ]; then
e201ec4
+			log error "syntax error while processing track numbers"
e201ec4
 		else
e201ec4
-			NEWTRACKS=$(f_seq_line $RSTART $REND)
e201ec4
+			RSTART=${1%%-*}
e201ec4
+			REND=${1##*-}
e201ec4
+			while [ ${RSTART:=1} -le ${REND:=0} ] ; do
e201ec4
+				TRACKQUEUE="$TRACKQUEUE $RSTART"
e201ec4
+				RSTART=$(( $RSTART + 1 ))
e201ec4
+			done
e201ec4
 		fi
e201ec4
-		TRACKQUEUE=$(echo "$TRACKQUEUE" "$NEWTRACKS")
e201ec4
 		shift
e201ec4
 	done
e201ec4
 fi
e201ec4
@@ -3249,7 +3252,11 @@ DOMOVE=n
e201ec4
 DOREPLAYGAIN=n
e201ec4
 DOPLAYLIST=n
e201ec4
 DOCLEAN=n
e201ec4
-DOCUE=n
e201ec4
+
e201ec4
+# Don't clobber the -M command-line flag.
e201ec4
+if [ -z "$DOCUE" ]; then
e201ec4
+	DOCUE=n
e201ec4
+fi
e201ec4
 
e201ec4
 for ACTION in $(echo $ACTIONS | tr , \ )
e201ec4
 do