Improve the parser to allow empty elements followed by a comma.
Now amixer works like below for setting only the third element.
% amixer cset 'IIR1 Band1' ,,200
Reported-and-tested-by: Arun Raghavan <arun@accosted.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
snd_ctl_elem_value_set_id(dst, myid);
for (idx = 0; idx < count && idx < 128 && ptr && *ptr; idx++) {
+ if (*ptr == ',')
+ goto skip;
switch (type) {
case SND_CTL_ELEM_TYPE_BOOLEAN:
tmp = 0;
default:
break;
}
+ skip:
if (!strchr(value, ','))
ptr = value;
else if (*ptr == ',')