From d018bf99c7c5e0121caa28f96145c101e11f0d02 Mon Sep 17 00:00:00 2001 From: Xara Date: Tue, 19 Jul 2011 22:25:50 -0700 Subject: [PATCH] Very, very very very very old bug from 2006, REGRESSION! Patch prevent console spam about failed locales set on systems where global locale is reported by "modern" way, I do not remember author, probably Tofu L. then others, not the better way (better is rewrite all this and fire such code OUT of loop!) --- indra/llui/llresmgr.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/llui/llresmgr.cpp b/indra/llui/llresmgr.cpp index 68fd08921..07649adfa 100644 --- a/indra/llui/llresmgr.cpp +++ b/indra/llui/llresmgr.cpp @@ -453,15 +453,17 @@ const std::string LLLocale::USER_LOCALE("en_US.utf8"); const std::string LLLocale::SYSTEM_LOCALE("C"); #endif +static std::string PrevFailedLocaleString = ""; LLLocale::LLLocale(const std::string& locale_string) { mPrevLocaleString = setlocale( LC_ALL, NULL ); char* new_locale_string = setlocale( LC_ALL, locale_string.c_str()); - if ( new_locale_string == NULL) + if ( new_locale_string == NULL && PrevFailedLocaleString != locale_string ) { llwarns << "Failed to set locale " << locale_string.c_str() << llendl; setlocale(LC_ALL, SYSTEM_LOCALE.c_str()); + PrevFailedLocaleString = locale_string; } //else //{