* libc/locale/locale.c (loadlocale): Allow three character

language codes to accommodate ISO 639-2 codes.
This commit is contained in:
Corinna Vinschen 2010-01-17 14:41:58 +00:00
parent 62910474ac
commit d24015235c
2 changed files with 12 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2010-01-17 Corinna Vinschen <corinna@vinschen.de>
* libc/locale/locale.c (loadlocale): Allow three character
language codes to accommodate ISO 639-2 codes.
2010-01-17 Corinna Vinschen <corinna@vinschen.de>
* libc/locale/locale.c (lc_ctype_charset): Disable defaulting to

View File

@ -51,8 +51,10 @@ the form
language[_TERRITORY][.charset][@@modifier]
<<"language">> is a two character string per ISO 639. <<"TERRITORY">> is a
country code per ISO 3166. For <<"charset">> and <<"modifier">> see below.
<<"language">> is a two character string per ISO 639, or, if not available
for a given language, a three character string per ISO 639-2.
<<"TERRITORY">> is a country code per ISO 3166. For <<"charset">> and
<<"modifier">> see below.
Additionally to the POSIX specifier, seven extensions are supported for
backward compatibility with older implementations using newlib:
@ -473,6 +475,9 @@ loadlocale(struct _reent *p, int category)
|| c[1] < 'a' || c[1] > 'z')
return NULL;
c += 2;
/* Allow three character Language per ISO 639-2 */
if (c[0] >= 'a' && c[0] <= 'z')
++c;
if (c[0] == '_')
{
/* Territory */