pgsql: Fix usage of char2wchar/wchar2char. - Mailing list pgsql-committers

From teodor@postgresql.org (Teodor Sigaev)
Subject pgsql: Fix usage of char2wchar/wchar2char.
Date
Msg-id 20090302151125.7323F7559ED@cvs.postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Fix usage of char2wchar/wchar2char. Changes:
- pg_wchar and wchar_t could have different size, so char2wchar
  doesn't call pg_mb2wchar_with_len to prevent out-of-bound
  memory bug
- make char2wchar/wchar2char symmetric, now they should not be
  called with C-locale because mbstowcs/wcstombs oftenly doesn't
  work correct with C-locale.
- Text parser uses pg_mb2wchar_with_len directly in case of
  C-locale and multibyte encoding

Per bug report by Hiroshi Inoue <inoue@tpf.co.jp> and
following discussion.

Backpatch up to 8.2 when multybyte support was implemented in tsearch.

Tags:
----
REL8_3_STABLE

Modified Files:
--------------
    pgsql/src/backend/tsearch:
        ts_locale.c (r1.7.2.1 -> r1.7.2.2)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/tsearch/ts_locale.c?r1=1.7.2.1&r2=1.7.2.2)
        wparser_def.c (r1.14.2.3 -> r1.14.2.4)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/tsearch/wparser_def.c?r1=1.14.2.3&r2=1.14.2.4)

pgsql-committers by date:

Previous
From: teodor@postgresql.org (Teodor Sigaev)
Date:
Subject: pgsql: Fix usage of char2wchar/wchar2char.
Next
From: teodor@postgresql.org (Teodor Sigaev)
Date:
Subject: pgsql: Fix usage of char2wchar/wchar2char.