Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2010-01-17 17:41:58 +0300
committerCorinna Vinschen <corinna@vinschen.de>2010-01-17 17:41:58 +0300
commitd24015235c9d3410f14935dd5e8861922ca45dbd (patch)
tree70c076aeee5cfe1f33329fb8e49d0858e61f5763 /newlib/libc/locale/locale.c
parent62910474ac7eaeddb7a51b6fdad14bcc852c9e93 (diff)
* libc/locale/locale.c (loadlocale): Allow three character
language codes to accommodate ISO 639-2 codes.
Diffstat (limited to 'newlib/libc/locale/locale.c')
-rw-r--r--newlib/libc/locale/locale.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/newlib/libc/locale/locale.c b/newlib/libc/locale/locale.c
index 8a74034d0..8eb943094 100644
--- a/newlib/libc/locale/locale.c
+++ b/newlib/libc/locale/locale.c
@@ -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 */