From: Daiki Ueno Date: Thu, 7 Mar 2013 08:47:37 +0000 (+0900) Subject: Signal a change of the loaded catalogs in libintl_setlocale. X-Git-Tag: v0.18.3~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a65a37654252fd3f958aa414e42f625a55868b90;p=thirdparty%2Fgettext.git Signal a change of the loaded catalogs in libintl_setlocale. --- diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog index 8b1f4dae3..562c282ac 100644 --- a/gettext-runtime/intl/ChangeLog +++ b/gettext-runtime/intl/ChangeLog @@ -1,3 +1,9 @@ +2013-03-07 Daiki Ueno + + * setlocale.c (libintl_setlocale): Signal a change of the loaded + catalogs by incrementing _nl_msg_cat_cntr. + Reported by Guido Flohr at . + 2013-05-30 Thomas Petazzoni (tiny change) * Makefile.in (SHELL): Use @SHELL@ instead of /bin/sh. diff --git a/gettext-runtime/intl/setlocale.c b/gettext-runtime/intl/setlocale.c index b33bff5d5..45fbc7b75 100644 --- a/gettext-runtime/intl/setlocale.c +++ b/gettext-runtime/intl/setlocale.c @@ -884,6 +884,7 @@ libintl_setlocale (int category, const char *locale) } /* All steps were successful. */ + ++_nl_msg_cat_cntr; free (saved_locale); return setlocale (LC_ALL, NULL); @@ -895,12 +896,16 @@ libintl_setlocale (int category, const char *locale) } else { + char *result; const char *name = gl_locale_name_environ (category, category_to_name (category)); if (name == NULL) name = gl_locale_name_default (); - return setlocale_single (category, name); + result = setlocale_single (category, name); + if (result != NULL) + ++_nl_msg_cat_cntr; + return result; } } else @@ -936,12 +941,18 @@ libintl_setlocale (int category, const char *locale) } /* It was really successful. */ + ++_nl_msg_cat_cntr; free (saved_locale); return setlocale (LC_ALL, NULL); } else # endif - return setlocale_single (category, locale); + { + char *result = setlocale_single (category, locale); + if (result != NULL) + ++_nl_msg_cat_cntr; + return result; + } } }