fix retrieving locale parts if region is not present

SVN revision: 81233
This commit is contained in:
Mike Blumenkrantz 2012-12-18 11:04:00 +00:00
parent f7490b2b0d
commit 77d578451c
1 changed files with 7 additions and 1 deletions

View File

@ -624,7 +624,7 @@ e_intl_locale_parts_get(const char *locale)
/* Parse Results */ /* Parse Results */
E_Locale_Parts *locale_parts; E_Locale_Parts *locale_parts;
char language[4]; char language[4];
char territory[4]; char territory[4] = {0};
char codeset[32]; char codeset[32];
char modifier[32]; char modifier[32];
@ -655,6 +655,12 @@ e_intl_locale_parts_get(const char *locale)
} }
else if ((tmp_idx < 2) && (islower(locale_char))) else if ((tmp_idx < 2) && (islower(locale_char)))
language[tmp_idx++] = locale_char; language[tmp_idx++] = locale_char;
else if (locale_char == '.') // no territory
{
state = 2;
language[tmp_idx] = 0;
tmp_idx = 0;
}
else else
return NULL; return NULL;
break; break;