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:
authorBastien Montagne <montagne29@wanadoo.fr>2013-01-21 14:46:01 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2013-01-21 14:46:01 +0400
commita679f6399f86b0ea03ec524880922d87f94fdbe5 (patch)
treee439792d65e8d0aa7e95e002754a7e307475acc2 /source/blender/blenfont/intern
parent88dd983f3cde0ee0cd91b3a9d12430ceff17d842 (diff)
Fixes to BLF_locale_explode, was not handling all cases correctly (own fault) :/
Diffstat (limited to 'source/blender/blenfont/intern')
-rw-r--r--source/blender/blenfont/intern/blf_lang.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenfont/intern/blf_lang.c b/source/blender/blenfont/intern/blf_lang.c
index c7a54c8714c..73294f1aed6 100644
--- a/source/blender/blenfont/intern/blf_lang.c
+++ b/source/blender/blenfont/intern/blf_lang.c
@@ -284,7 +284,7 @@ void BLF_locale_explode(const char *locale, char **language, char **country, cha
*language = _t;
}
else if (language) {
- *language = NULL;
+ *language = BLI_strdup(locale);
}
}
if (country) {
@@ -300,14 +300,14 @@ void BLF_locale_explode(const char *locale, char **language, char **country, cha
*variant = NULL;
}
if (language_country) {
- if (m2)
- *language_country = BLI_strdupn(locale, m2 - locale);
+ if (m1)
+ *language_country = m2 ? BLI_strdupn(locale, m2 - locale) : BLI_strdup(locale);
else
*language_country = NULL;
}
if (language_variant) {
if (m2)
- *language_variant = m1 ? BLI_strdupcat(_t, m2 + 1) : BLI_strdup(locale);
+ *language_variant = m1 ? BLI_strdupcat(_t, m2) : BLI_strdup(locale);
else
*language_variant = NULL;
}