NetBSD Problem Report #8748

Received: (qmail 29557 invoked from network); 5 Nov 1999 04:11:47 -0000
Message-Id: <199911050407.XAA20046@ursula.wongs.net>
Date: Thu, 4 Nov 1999 23:07:38 -0500 (EST)
From: Ben Wong <hackerb9@ursula.wongs.net>
Reply-To: hackerb9@ursula.wongs.net
To: gnats-bugs@gnats.netbsd.org
Subject: audioplay exits on empty string arguments ""
X-Send-Pr-Version: 3.95

>Number:         8748
>Category:       bin
>Synopsis:       audioplay exits on empty string arguments ""
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 04 20:12:00 +0000 1999
>Closed-Date:    Sat Nov 06 15:06:13 +0000 1999
>Last-Modified:  Sat Nov 06 15:07:53 +0000 1999
>Originator:     Ben Wong
>Release:        1.4.1
>Organization:
>Environment:

System: NetBSD ursula.wongs.net 1.4.1 NetBSD 1.4.1 (AMNESIAC) #7: Thu Oct 14 22:00:19 EDT 1999 hackerb9@ursula.wongs.net:/usr/src/sys/arch/i386/compile/AMNESIAC i386


>Description:

When audioplay is passed an argument which is the empty string, it
tries to open that as the name of a file to play. It dies with an
error message instead of continuing on to see if there are any valid
files to play in argv. This is a problem because some playlist
managers (such as xhippo) might send in the empty string in the middle
of the arg list.

Ideally audioplay should both (a) be silent about the empty string is
passed in and (b) continue playing other files that may have been
listed even if a previous one caused an error.

>How-To-Repeat:

Assuming you have an audiofile in your cwd called "somefile.wav"

	audioplay "" somefile.wav

audioplay will never play somefile.wav

>Fix:

Make audioplay check if the argument string is empty and silently go
on to the next argument. Also, someone should probably change many of
the calls to err() with warnx() since it shouldn't be fatal if one out
of many files is missing or of an unknown format.

Here is a patch for /usr/src/usr.bin/audio/play/play.c to make
audioplay work with xhippo:

*** play.c~     Thu Nov  4 22:55:30 1999
--- play.c      Thu Nov  4 22:56:25 1999
***************
*** 185,190 ****
--- 185,193 ----
                void *addr, *oaddr;

                do {
+                       if (strlen(*argv) == 0)
+                         continue;
+ 
                        fd = open(*argv, O_RDONLY);
                        if (fd < 0)
                                err(1, "could not open %s", *argv);
>Release-Note:
>Audit-Trail:

From: Klaus Klein <kleink@ira.uka.de>
To: hackerb9@ursula.wongs.net
Cc: gnats-bugs@gnats.netbsd.org, kleink@ira.uka.de
Subject: Re: bin/8748: audioplay exits on empty string arguments ""
Date: 05 Nov 1999 13:48:20 +0100

 The current behaviour what one would expect taking POSIX (the empty
 string is not a pathname) into consideration. If the behaviour is to
 be changed, it should be `print warning on stderr, goto next file' and
 reflect the error in the exit status.
State-Changed-From-To: open->closed 
State-Changed-By: kleink 
State-Changed-When: Sat Nov 6 07:06:13 PST 1999 
State-Changed-Why:  
Changed the behaviour as proposed in the audit trail.  (Note that the 
originator's mail address bounces, so no feedback was possible.) 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.