Skip site navigation (1) Skip section navigation (2)

pg_locale (Was: Re: Problem with setlocale (found in libecpg)...)

From: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
To: pgsql-patches <pgsql-patches(at)postgreSQL(dot)org>
Cc: Christof Petig <christof(at)petig-baender(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: pg_locale (Was: Re: Problem with setlocale (found in libecpg)...)
Date: 2001-09-27 10:11:15
Message-ID: 20010927121115.E31778@zf.jcu.cz (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
On Thu, Sep 27, 2001 at 12:08:29AM -0400, Tom Lane wrote:
> >> Well at least on glibc-2.2 it seems that setlocale retuns a pointer to
> >> malloced memory, and frees this pointer on subsequent calls to
> >> setlocale.
> >> So I would kindly ask you to take a second look at every invokation of
> >> setlocale.
> 
> I looked around, and am worried about the behavior of PGLC_current()
> in src/backend/utils/adt/pg_locale.c.  It doesn't change locale but
> does retrieve several successive setlocale() results.  Does that work
> in glibc?

 The patch is attached. Now it's independent on glibc's game of setlocale()
results and free/strdup. It works for me...

 Thanks to Christof!

	Karel

-- 
 Karel Zak  <zakkr(at)zf(dot)jcu(dot)cz>
 http://home.zf.jcu.cz/~zakkr/
 
 C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz

Attachment: pg_locale-09272001.patch.gz
Description: application/x-gzip (983 bytes)

In response to

Responses

pgsql-hackers by date

Next:From: Christof PetigDate: 2001-09-27 10:17:31
Subject: Re: [PATCHES] Problem with setlocale (found in libecpg) [accessing a
Previous:From: Hannu KrosingDate: 2001-09-27 09:48:47
Subject: Re: Converting from pgsql to sqlserver?

pgsql-patches by date

Next:From: Christof PetigDate: 2001-09-27 10:17:31
Subject: Re: [PATCHES] Problem with setlocale (found in libecpg) [accessing a
Previous:From: Karel ZakDate: 2001-09-27 08:49:24
Subject: Re: [PATCHES] Problem with setlocale (found in libecpg) [accessing a

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group