Re: [PATCHES] mb support fix

From: The Hermit Hacker <scrappy(at)hub(dot)org>
To: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
Cc: pgsql-patches(at)postgreSQL(dot)org, hackers(at)postgreSQL(dot)org
Subject: Re: [PATCHES] mb support fix
Date: 1999-01-27 01:18:12
Message-ID: Pine.BSF.4.05.9901262118070.76634-100000@thelab.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Applied...

On Wed, 27 Jan 1999, Tatsuo Ishii wrote:

> Included patches fix a portability problem of unsetenv() used in
> 6.4.2 multi-byte support. unsetenv() is only avaliable on FreeBSD and
> Linux so I decided to replace with putenv().
> --
> Tatsuo Ishii
> t-ishii(at)sra(dot)co(dot)jp
> ----------------------------- cut here ----------------------------
> *** postgresql-6.4.2/src/bin/psql/psql.c.orig Wed Jan 6 13:25:45 1999
> --- postgresql-6.4.2/src/bin/psql/psql.c Wed Jan 6 13:26:27 1999
> ***************
> *** 1498,1504 ****
> PGCLIENTENCODING value. -- 1998/12/12 Tatsuo Ishii */
>
> if (!has_client_encoding) {
> ! unsetenv("PGCLIENTENCODING");
> }
> #endif
>
> --- 1498,1505 ----
> PGCLIENTENCODING value. -- 1998/12/12 Tatsuo Ishii */
>
> if (!has_client_encoding) {
> ! static const char ev[] = "PGCLIENTENCODING=";
> ! putenv(ev);
> }
> #endif
>
> *** postgresql-6.4.2/src/interfaces/libpq/fe-print.c.orig Wed Jan 6 13:27:21 1999
> --- postgresql-6.4.2/src/interfaces/libpq/fe-print.c Wed Jan 6 13:29:19 1999
> ***************
> *** 506,512 ****
> int encoding = -1;
>
> str = getenv("PGCLIENTENCODING");
> ! if (str)
> encoding = pg_char_to_encoding(str);
> if (encoding < 0)
> encoding = MULTIBYTE;
> --- 506,512 ----
> int encoding = -1;
>
> str = getenv("PGCLIENTENCODING");
> ! if (str && *str != NULL)
> encoding = pg_char_to_encoding(str);
> if (encoding < 0)
> encoding = MULTIBYTE;
> *** postgresql-6.4.2/src/interfaces/libpq/fe-connect.c.orig Wed Jan 6 13:29:47 1999
> --- postgresql-6.4.2/src/interfaces/libpq/fe-connect.c Wed Jan 6 13:30:55 1999
> ***************
> *** 813,819 ****
> #ifdef MULTIBYTE
> /* query server encoding */
> env = getenv(envname);
> ! if (!env)
> {
> rtn = PQexec(conn, "select getdatabaseencoding()");
> if (rtn && PQresultStatus(rtn) == PGRES_TUPLES_OK)
> --- 813,819 ----
> #ifdef MULTIBYTE
> /* query server encoding */
> env = getenv(envname);
> ! if (!env || *env == NULL)
> {
> rtn = PQexec(conn, "select getdatabaseencoding()");
> if (rtn && PQresultStatus(rtn) == PGRES_TUPLES_OK)
>

Marc G. Fournier
Systems Administrator @ hub.org
primary: scrappy(at)hub(dot)org secondary: scrappy(at){freebsd|postgresql}.org

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Vadim Mikheev 1999-01-27 02:20:42 Re: [HACKERS] Major breakage?
Previous Message Tatsuo Ishii 1999-01-27 00:59:38 mb support fix