Don't complain about deprecated environment variables, like MUSIC_CD,

being present in the environment if the user has CDROM defined, or
has specified a device on the command line.

This avoids users of ports like 'workman' that use these variables
getting gratuitous warnings from cdcontrol.

Suggested by:	John Sellens <jsellens@generalconcepts.com>
This commit is contained in:
Josef Karthauser 2001-04-08 21:35:17 +00:00
parent 021bcbceea
commit b074e88895
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=75324

View File

@ -176,14 +176,6 @@ int main (int argc, char **argv)
int cmd;
char *arg;
cdname = use_cdrom_instead("MUSIC_CD");
if (! cdname)
cdname = use_cdrom_instead("CD_DRIVE");
if (! cdname)
cdname = use_cdrom_instead("DISC");
if (! cdname)
cdname = use_cdrom_instead("CDPLAY");
for (;;) {
switch (getopt (argc, argv, "svhf:")) {
case EOF:
@ -213,6 +205,15 @@ int main (int argc, char **argv)
cdname = getenv("CDROM");
}
if (! cdname)
cdname = use_cdrom_instead("MUSIC_CD");
if (! cdname)
cdname = use_cdrom_instead("CD_DRIVE");
if (! cdname)
cdname = use_cdrom_instead("DISC");
if (! cdname)
cdname = use_cdrom_instead("CDPLAY");
if (! cdname) {
cdname = DEFAULT_CD_DRIVE;
warnx("no CD device name specified, defaulting to %s", cdname);