[alsa-devel] [PATCH] ucm: Allow cset commands to have values with spaces.

Kaskinen Tanu tanu.kaskinen at digia.com
Thu Aug 9 16:44:12 CEST 2012


On Thu, 2012-08-09 at 16:07 +0200, Takashi Iwai wrote:
> At Thu, 9 Aug 2012 16:43:31 +0300,
> Tanu Kaskinen wrote:
> > @@ -170,8 +170,23 @@ static int execute_cset(snd_ctl_t *ctl, char *cset)
> >  	snd_ctl_elem_value_malloc(&value);
> >  	snd_ctl_elem_info_malloc(&info);
> >  
> > -	pos = strrchr(cset, ' ');
> > -	if (pos == NULL) {
> > +	/* Find the space after the element id, taking quoting with
> > +	   single-quotes into account. */
> > +	for (pos = cset; *pos != '\0'; pos += strcspn(pos, "' ")) {
> > +		if (*pos == ' ')
> > +			break;
> > +		if (*pos == '\'') {
> 
> A double-quote can be supported easily here...

True, I'll post v2 soon.

-- 
Tanu



More information about the Alsa-devel mailing list