Re: [pgsql-hackers-win32] %2$, %1$ gettext placeholder replacement is not working under Win32

Поиск
Список
Период
Сортировка
От Nicolai Tufar
Тема Re: [pgsql-hackers-win32] %2$, %1$ gettext placeholder replacement is not working under Win32
Дата
Msg-id d809293905011712162e0d34fc@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [pgsql-hackers-win32] %2$, %1$ gettext placeholder replacement is not working under Win32  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Mon, 17 Jan 2005 14:54:44 -0500, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Also, it looks like src/port/snprintf.c is not %n$ capable either.
> I'm not sure which platforms that affects.
>
> A possible route to a solution is to upgrade snprintf.c and then use
> it on platforms that don't have this support.  This only fixes those
> cases where we go through snprintf, which is probably not all of the
> affected messages, but it might be enough.  It's not happening for
> 8.0.0 though.

Bad news for the Turks. Turkish language syntax
is lake Latin: the verb is always at the end. Because
of that almost all messages that have two or more
placeholders are broken under Windows.

The solution you propose seem to be a trivial exercise:
1. write a replacement function, say, pg_snprintf() that
    would shuffle input arguments, replace %x$ with %
    and then call libc's snprintf();
2. replace snprintf() in all source files with pg_snprintf();
3. Update Makefiles to use our custom function on broken
    platforms or default to snprinf(). (Or maybe pg_snprintf()
    should be a #define);
4. Tell everyone to use pg_snprintf() instead of snprintf()
     from now on.

I would like volunteer to implement this for 8.1 and
would be honoured if I get a chance to contribute.

>                         regards, tom lane

Best regards,
Nicolai Tufar

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Devrim GUNDUZ
Дата:
Сообщение: Re: [pgsql-hackers-win32] %2$, %1$ gettext placeholder
Следующее
От: Tom Lane
Дата:
Сообщение: Re: ARC patent