-/* $OpenBSD: aucat.c,v 1.78 2021/11/01 14:43:24 ratchov Exp $ */
+/* $OpenBSD: aucat.c,v 1.79 2021/11/07 20:51:47 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
}
p++;
if (type == 0) {
- devnum = AMSG_NODEV;
- p = parsestr(p, opt, AMSG_OPTMAX);
- if (p == NULL)
- return 0;
+ if (*p < '0' || *p > '9') {
+ devnum = AMSG_NODEV;
+ p = parsestr(p, opt, AMSG_OPTMAX);
+ if (p == NULL)
+ return 0;
+ } else {
+ p = _sndio_parsenum(p, &devnum, 15);
+ if (p == NULL)
+ return 0;
+ if (*p == '.') {
+ p = parsestr(++p, opt, AMSG_OPTMAX);
+ if (p == NULL)
+ return 0;
+ } else
+ strlcpy(opt, "default", AMSG_OPTMAX);
+ }
} else {
p = _sndio_parsenum(p, &devnum, 15);
if (p == NULL)