$Id$
+Sat Dec 3 10:28:03 CET 2005 dothebart
+* fixed langage detection to work with simple 'de' and no other stuff
+
Fri Dec 2 17:49:32 EST 2005 ajc
* Re-enabled browser language detection. This will be debugged and finalized.
// char *webcitdir = WEBCITDIR;
locale_t my_Locale;
locale_t my_Empty_Locale;
+
+ // len = strlen(LocaleString);
memcpy(search, LocaleString, len);
- search[len + 1] = '\0';
- len = strlen(search);
+ search[len] = '\0';
/* the web browser sends '-', we need '_' */
for (i = 0; i < len; i++)
if (search[i] == '-')
search[i] = '_';
i = 0;
- while ((search[i] != '\0') && !done && (nFound < 10)) {
- if ((search[i] == ',') || (search[i] == ';'))
+ while ( !done && (nFound < 10)) {
+ if ((search[i] == ',') || (search[i] == ';') || (search[i] == '\0'))
{
- if (search[i] == ';')
+ if ((search[i] == ';') || (search[i] == '\0'))
done = 1;
search[i] = '\0';
wanted_locales[nFound] = (char *) &search[j];
}
/* todo: weight */
- for (i = 0; i <= nFound; i++) {
+ if (nFound > 0) for (i = 0; i <= nFound; i++) {
for (j = 0; j < nAvail; j++) {
int ret = strncasecmp(wanted_locales[i],
AvailLang[j],