Update of /cvsroot/xine/xine-lib/src/xine-utils
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3368/src/xine-utils
Modified Files:
utils.c
Log Message:
Fix detection of locale containing a modifier (like "@euro")
thanks Reinhard Nissl
Index: utils.c
===================================================================
RCS file: /cvsroot/xine/xine-lib/src/xine-utils/utils.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- utils.c 5 Sep 2005 17:02:57 -0000 1.42
+++ utils.c 5 Feb 2006 16:15:12 -0000 1.43
@@ -490,13 +490,22 @@
static const lang_locale_t *_get_first_lang_locale(char *lcal) {
const lang_locale_t *llocale;
+ int lang_len;
+ char *mod;
if(lcal && strlen(lcal)) {
llocale = &*lang_locales;
+
+ if ((mod = strchr(lcal, '@')))
+ lang_len = mod++ - lcal;
+ else
+ lang_len = strlen(lcal);
while(llocale->language) {
- if(!strncmp(lcal, llocale->language, strlen(lcal)))
- return llocale;
+ if(!strncmp(lcal, llocale->language, lang_len)) {
+ if ((!mod && !llocale->modifier) || (mod && llocale->modifier && !strcmp(mod, llocale->modifier)))
+ return llocale;
+ }
llocale++;
}
|