Re: BUG #6510: A simple prompt is displayed using wrong charset

Поиск
Список
Период
Сортировка
От Noah Misch
Тема Re: BUG #6510: A simple prompt is displayed using wrong charset
Дата
Msg-id 20121015233817.GC13670@tornado.leadboat.com
обсуждение исходный текст
Ответ на Re: BUG #6510: A simple prompt is displayed using wrong charset  (Noah Misch <noah@leadboat.com>)
Ответы Re: BUG #6510: A simple prompt is displayed using wrong charset  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-bugs
On Mon, Oct 15, 2012 at 05:41:36AM -0400, Noah Misch wrote:
> > --- a/src/port/sprompt.c
> > +++ b/src/port/sprompt.c
> > @@ -60,8 +60,13 @@ simple_prompt(const char *prompt, int maxlen, bool echo)
> >       * Do not try to collapse these into one "w+" mode file. Doesn't work on
> >       * some platforms (eg, HPUX 10.20).
> >       */
> > +#ifdef WIN32
> > +    termin = fopen("CONIN$", "r");
> > +    termout = fopen("CONOUT$", "w+");
>
> This definitely needs a block comment explaining the behaviors that led us to
> select this particular implementation.
>
> > +#else
> >      termin = fopen(DEVTTY, "r");
> >      termout = fopen(DEVTTY, "w");
>
> This thread has illustrated that the DEVTTY abstraction does not suffice.  I
> think we should remove it entirely.  Remove it from port.h; use literal
> "/dev/tty" here; re-add it as a local #define near the one remaining use, with
> an XXX comment indicating that the usage is broken.
>
> If it would help, I can prepare a version with the comment changes and
> refactoring I have in mind.

Following an off-list ack from Alexander, here is that version.  No functional
differences from Alexander's latest version, and I have verified that it still
fixes the original test case.  I'm marking this Ready for Committer.

To test this on an English (United States) copy of Windows 7, I made two
configuration changes in the "Region and Language" control panel.  On the
"Administrative" tab, choose "Change system locale..." and select Russian
(Russia).  After the reboot, choose "Russian (Russia)" on the "Format" tab.
(Neither of these changes will affect the display language of most Windows UI
components.)  Finally, run "initdb -W testdatadir".  Before the patch, the
password prompt contained some line-drawing characters and other garbage.
Afterward, it matches the string in src/bin/initdb/po/ru.po.

Thanks,
nm

Вложения

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: pg_ctl restart issue with relative paths
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: BUG #7602: Select with many joins against the same table is very slow compared to 9.2.0.