Subject: Re: a proposal for two new libc functions: shquote() and shquotev()
To: Charles M. Hannum <root@ihack.net>
From: Chris G. Demetriou <cgd@netbsd.org>
List: tech-userlevel
Date: 03/03/2001 00:44:20
"Charles M. Hannum" <root@ihack.net> writes:
> <evil>
> Maybe we could make this a printf() format and just use asprintf().
> </evil>

Yes, evil.  Not good evil, either.  8-)

That reminds me of another point:

One of the goals here is easy portability to other OSes.  There's
absolutely zero magic in these functions.  This is also why i give a
whit about what bash does.  8-)

Why?  These functions are needed to properly implement the chunks of
many programs that do stuff like: "${CC} args files..." or similar.
Many things do that, but a _lot_ of the 'host tools' needed for
cross-compilation do.

If you stuff it into printf (or otherwise encourage the programs to
start using non-standard features in our stdio), programs get to be a
real PITA to port.  You need to port the whole bloody stdio.


Note that this follows a theme: proper use of getprogname() and
setprogname() make it much easier to port our host tools to other
platforms, and implement non-standard APIs present in NetBSD which
they like to use (e.g. err and warn)...

Who knows what's next.  8-)


cgd
-- 
Chris Demetriou - cgd@netbsd.org - http://www.netbsd.org/People/Pages/cgd.html
Disclaimer: Not speaking for NetBSD, just expressing my own opinion.