play(1): handle file names containing consecutive spaces
This commit is contained in:
parent
583c6d269b
commit
1de2698dc8
1 changed files with 4 additions and 2 deletions
|
@ -1,6 +1,8 @@
|
||||||
#!/bin/rc
|
#!/bin/rc
|
||||||
rfork e
|
rfork e
|
||||||
|
|
||||||
|
nl='
|
||||||
|
'
|
||||||
out=/dev/audio
|
out=/dev/audio
|
||||||
typ=()
|
typ=()
|
||||||
tmp=()
|
tmp=()
|
||||||
|
@ -31,7 +33,7 @@ fn play1 {
|
||||||
if not {
|
if not {
|
||||||
switch($2){
|
switch($2){
|
||||||
case *plain*
|
case *plain*
|
||||||
sed 's/
//g' | while(j=`{read}){
|
sed 's/
//g' | while(j=`$nl{read}){
|
||||||
echo $"j >[1=2]
|
echo $"j >[1=2]
|
||||||
if(~ $"j http:* https:* HTTP:* HTTPS:*){
|
if(~ $"j http:* https:* HTTP:* HTTPS:*){
|
||||||
hget -r 'User-Agent: play' -r 'Icy-MetaData: 0' $"j | play1 $"j
|
hget -r 'User-Agent: play' -r 'Icy-MetaData: 0' $"j | play1 $"j
|
||||||
|
@ -104,5 +106,5 @@ while(~ $1 -*){
|
||||||
|
|
||||||
>$out {
|
>$out {
|
||||||
if(~ $#* 0){play1 stdin; exit}
|
if(~ $#* 0){play1 stdin; exit}
|
||||||
for(i){echo $i} | play1 args plain
|
for(i){echo $"i} | play1 args plain
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue