diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-02-04 14:02:47 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-02-04 14:02:47 +0300 |
commit | 66eacc2abbe0aa5ed7f37c0b67a84bf44eca9adc (patch) | |
tree | ea1cfb757e641effc834f52487ef3488ae01f72f /source/blender/blenfont | |
parent | 3b0c4d888cc5f342c40c6a33fef5ed7c0c3058e7 (diff) |
Fix for recent LANG locale workaround
Need to get a copy of the string since stored pointer is affected
by subsequent calls of setlocale().
Diffstat (limited to 'source/blender/blenfont')
-rw-r--r-- | source/blender/blenfont/intern/blf_lang.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenfont/intern/blf_lang.c b/source/blender/blenfont/intern/blf_lang.c index 8951ef50607..7206d71b3b8 100644 --- a/source/blender/blenfont/intern/blf_lang.c +++ b/source/blender/blenfont/intern/blf_lang.c @@ -211,11 +211,14 @@ void BLF_lang_init(void) const char *lang = getenv("LANG"); 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 |