summaryrefslogtreecommitdiff
path: root/community/cuetools/cuetag-fix_spaces.diff
blob: f240e9d3755cc7eba2cd60556bf6915d6ae62916 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From 21ee6cc40f02693928efbc4f3beeb681950c16b5 Mon Sep 17 00:00:00 2001
From: Svend Sorensen <svend@ciffer.net>
Date: Sat, 23 Nov 2013 17:23:01 -0800
Subject: [PATCH] cuetag: Fix handling of spaces in file names

Fixes #14
---
 src/tools/cuetag.sh | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/tools/cuetag.sh b/src/tools/cuetag.sh
index f26fa20..448920f 100755
--- a/src/tools/cuetag.sh
+++ b/src/tools/cuetag.sh
@@ -182,16 +182,15 @@ main()
 	ntrack=$(cueprint -d '%N' "$cue_file")
 	trackno=1
 
-	FILES= FIELDS=
+	NUM_FILES=0 FIELDS=
 	for arg in "$@"; do
 		case "$arg" in
-			*.*) FILES="$FILES $arg";;
+			*.*) NUM_FILES=$(expr $NUM_FILES + 1);;
 			*) FIELDS="$FIELDS $arg";;
 		esac
 	done
 
-	set -- $FILES
-	if [ $# -ne $ntrack ]; then
+	if [ $NUM_FILES -ne $ntrack ]; then
 		echo "warning: number of files does not match number of tracks"
 	fi
 
@@ -209,7 +208,7 @@ main()
 		*.[Tt][Xx][Tt])
 			vorbis $trackno "$file"
 			;;
-		*)
+		*.*)
 			echo "$file: uknown file type"
 			;;
 		esac
-- 
1.8.5.1