Re: [PATCH/RFC 07/17] gettext.c: work around us not using setlocale(LC_CTYPE, "")
- From
Marcin Cieslak <saper@saper.info>
- Date
- Aug 31, 2010, 15:37 UTC
- Message-ID
- <alpine.BSF.2.00.1008311534390.12745@x.fncre.vasb>
- In-Reply-To
- <20100831151800.GG2315@burratino>
On Tue, 31 Aug 2010, Jonathan Nieder wrote:
Show 11 quoted lines
> Ævar Arnfjörð Bjarmason wrote: > >> In 107880a I removed our use of setlocale(LC_CTYPE, "") because of a >> bug in the GNU C Library [1] > > Future readers might benefit from a reminder that it is vsnprintf that > is broken. > > Aside, not about this patch: glibc printf can be very convenient for > translators, because of format strings like "%4$s". Do other common > platforms like FreeBSD and Mingw have something similar?
Speaking for FreeBSD:
% svn log -r21674 printf.3 ------------------------------------------------------------------------ r21674 | jkh | 1997-01-14 08:31:39 +0100 (wto) | 8 linii
The following patch to lib/libc/stdio implements positional arguments in a manner consistent with other implementations. Its done in a way that adds only a tiny amount of overhead when positional arguments are not used. I also have a test program to go with this, but don't know where it belongs in the tree.
Submitted-By: Bill Fenner <fenner@FreeBSD.ORG>
------------------------------------------------------------------------
Solaris 9 has it, too.
--Marcin