Subject: Re: gettext 0.14+ and libintl_printf issues
To: Roland Illig <rillig@NetBSD.org>
From: David Laight <david@l8s.co.uk>
List: tech-pkg
Date: 02/08/2006 20:42:18
On Tue, Feb 07, 2006 at 10:28:00PM +0100, Roland Illig wrote:
> joerg@britannica.bec.de wrote:
> >A solution adopted by the Open Group as extension in the Single Unix
> >Specification is to allow positional arguments in the format string, so
> >that
> > printf(_("%d/%d/%d"), year, month, day);
> >would have a translated format string for German as
>
> "%3$d.%2$d.%1$d" of course.
>
> (Though I can understand this typo very well, as this is awful to type.)
It is also almost impossible to code and use correctly [1].
Never mind the security implications of allowing $n in printf strings
read from message files.
David
"%*.*s" is equivalent to "%3$*1$.*2$s" - note that the numbers aren't in
order.
--
David Laight: david@l8s.co.uk