Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenfont/intern/blf_lang.c')
-rw-r--r--source/blender/blenfont/intern/blf_lang.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenfont/intern/blf_lang.c b/source/blender/blenfont/intern/blf_lang.c
index 8951ef50607..99e1aa5d3e3 100644
--- a/source/blender/blenfont/intern/blf_lang.c
+++ b/source/blender/blenfont/intern/blf_lang.c
@@ -209,13 +209,16 @@ void BLF_lang_init(void)
* Would also be good to find nicer way to check if LANG is correct.
*/
const char *lang = getenv("LANG");
- if(lang != NULL) {
+ if (lang != NULL) {
char *old_locale = setlocale(LC_ALL, NULL);
+ /* Make a copy so subsequenct setlocale() doesn't interfere. */
+ old_locale = BLI_strdup(old_locale);
if (setlocale(LC_ALL, lang) == NULL) {
setenv("LANG", "C", 1);
printf("Warning: Falling back to the standard locale (\"C\")\n");
}
setlocale(LC_ALL, old_locale);
+ MEM_freeN(old_locale);
}
#endif