From a679f6399f86b0ea03ec524880922d87f94fdbe5 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 21 Jan 2013 10:46:01 +0000 Subject: Fixes to BLF_locale_explode, was not handling all cases correctly (own fault) :/ --- source/blender/blenfont/intern/blf_lang.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/blenfont/intern') 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; } -- cgit v1.2.3