[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53949] trunk/blender/source/blender/ blenfont/intern/blf_lang.c: Fixes to BLF_locale_explode, was not handling all cases correctly (own fault) :/

Bastien Montagne montagne29 at wanadoo.fr
Mon Jan 21 11:46:03 CET 2013


Revision: 53949
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53949
Author:   mont29
Date:     2013-01-21 10:46:01 +0000 (Mon, 21 Jan 2013)
Log Message:
-----------
Fixes to BLF_locale_explode, was not handling all cases correctly (own fault) :/

Modified Paths:
--------------
    trunk/blender/source/blender/blenfont/intern/blf_lang.c

Modified: trunk/blender/source/blender/blenfont/intern/blf_lang.c
===================================================================
--- trunk/blender/source/blender/blenfont/intern/blf_lang.c	2013-01-21 09:54:33 UTC (rev 53948)
+++ trunk/blender/source/blender/blenfont/intern/blf_lang.c	2013-01-21 10:46:01 UTC (rev 53949)
@@ -284,7 +284,7 @@
 				*language = _t;
 		}
 		else if (language) {
-			*language = NULL;
+			*language = BLI_strdup(locale);
 		}
 	}
 	if (country) {
@@ -300,14 +300,14 @@
 			*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;
 	}




More information about the Bf-blender-cvs mailing list