[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#474973: artsdsp does not handle args with spaces properly (fix included)



Package: libarts1c2a
Version: 1.5.9-2

When trying to play mp3 files containing white space in their file name, the 
filename is being broken into pieces.

---transcript
$ artsdsp mpg123 lass\ uns\ spielen.mp3 
decoder: SSE
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
        version 0.67; written and copyright by Michael Hipp and others
        free software (LGPL/GPL) without any warranty but with best wishes
lass: No such file or directory
uns: No such file or directory
spielen.mp3: No such file or directory
$
---end transcript

Reason: set does not preserve spaces in arguments properly.

Solution: the following patch against artsdsp avoids usage of "set".

Mit freundlichem Gruß / With kind regards
	Holger Klawitter
--
info@klawitter.de
--- /usr/bin/artsdsp	2008-03-30 13:35:48.000000000 +0200
+++ my-artsdsp	2008-04-08 11:14:16.271323397 +0200
@@ -90,13 +90,14 @@
 fi
 
 # setup artsdsp preload to hijack calls made to /dev/dsp
-origargs="$@"
 binary=`which $1`
 machine=`uname -m`
 
-set `file -L $binary`
+file_data=$(file -L $binary)
+TYPE=$(echo $file_data|awk '{print $2}')
+ARCH=$(echo $file_data|awk '{print $3}')
 
-case $2 in
+case $TYPE in
     ELF)
        ;;
     *)
@@ -104,7 +105,7 @@
        exit 1
     esac
 
-case $3 in
+case $ARCH in
     32-bit)
        arch_libdir=lib
        ;;
@@ -115,7 +116,6 @@
        exit 1
 esac
 
-set $origargs
 
 prefix=/usr
 exec_prefix=${prefix}

Reply to: