Subject: Re: a proposal for two new libc functions: shquote() and shquotev()
To: Chris G. Demetriou <cgd@netbsd.org>
From: Charles M. Hannum <root@ihack.net>
List: tech-userlevel
Date: 03/02/2001 23:13:33
On Fri, Mar 02, 2001 at 10:58:48PM -0800, Chris G. Demetriou wrote:
> christos@zoulas.com (Christos Zoulas) writes:
> > How about an allocating version like asprintf()? That would cut down your
> > example significantly.
> 
> I can imagine some trivial cases where that'd help, when _all_ of your
> arguments are coming from the argc/argv given to shquotev().
> 
> However, for the most part, you have to combine the result of
> shquote() or shquotev() with other strings.  That would mean that
> you'd have to do something like: quote+allocate, calculate length of
> combined string, allocate for it, combine, then free the thing
> allocated by "quote+allocate"...  it doesn't help.  8-)

<evil>
Maybe we could make this a printf() format and just use asprintf().
</evil>