From 3a91d9516ed0045640498d2c4584a2966672c6d5 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 8 Dec 2005 16:49:56 +0000 Subject: [PATCH] * Fix "locale leak" on newer Linux systems where gettext() seems to cache its translated messages. textdomain(textdomain(NULL)) clears the cache. --- webcit/ChangeLog | 4 ++++ webcit/gettext.c | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index ed04cffee..18011f39f 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,5 +1,9 @@ $Id$ +Thu Dec 8 11:48:34 EST 2005 ajc +* Fix "locale leak" on newer Linux systems where gettext() seems to cache + its translated messages. textdomain(textdomain(NULL)) clears the cache. + Wed Dec 7 22:22:09 EST 2005 ajc * Improved the reliability of per-thread locale by unsetting it at the end of each transaction. diff --git a/webcit/gettext.c b/webcit/gettext.c index 421e668d0..1f632ca9b 100644 --- a/webcit/gettext.c +++ b/webcit/gettext.c @@ -180,11 +180,13 @@ void set_selected_language(char *lang) { * Activate and deactivate the selected language for this session. */ void go_selected_language(void) { - uselocale(wc_locales[WC->selected_language]); + uselocale(wc_locales[WC->selected_language]); /* switch locales */ + textdomain(textdomain(NULL)); /* clear the cache */ } void stop_selected_language(void) { - uselocale(LC_GLOBAL_LOCALE); + uselocale(LC_GLOBAL_LOCALE); /* switch locales */ + textdomain(textdomain(NULL)); /* clear the cache */ } -- 2.39.2