All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kaskinen Tanu <tanu.kaskinen@digia.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH] ucm: Allow cset commands to have values with spaces.
Date: Thu, 9 Aug 2012 18:23:29 +0300	[thread overview]
Message-ID: <1344525809.4283.44.camel@IT-D-4QB9Z4J> (raw)
In-Reply-To: <s5hboik14lm.wl%tiwai@suse.de>

On Thu, 2012-08-09 at 17:12 +0200, Takashi Iwai wrote:
> At Thu, 9 Aug 2012 17:44:12 +0300,
> Kaskinen Tanu wrote:
> > 
> > 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.
> 
> On the second thought, parsing the string intensively at that point
> doesn't make sense.  The string will be parsed anyway in
> snd_ctl_ascii_elem_id_parse(), then why not just let it give the next
> pointer from there?
> 
> Below is a quick hack (untested at all!).  Could you check whether it
> works?

It does :)

-- 
Tanu

  reply	other threads:[~2012-08-09 14:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-09 13:43 [PATCH] ucm: Allow cset commands to have values with spaces Tanu Kaskinen
2012-08-09 14:07 ` Takashi Iwai
2012-08-09 14:44   ` Kaskinen Tanu
2012-08-09 15:12     ` Takashi Iwai
2012-08-09 15:23       ` Kaskinen Tanu [this message]
2012-08-09 15:16 ` [PATCH v2] " Tanu Kaskinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1344525809.4283.44.camel@IT-D-4QB9Z4J \
    --to=tanu.kaskinen@digia.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.