]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Recognize the full POSIX locale name syntax.
authorBruno Haible <bruno@clisp.org>
Wed, 19 Oct 2005 10:58:29 +0000 (10:58 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:12:55 +0000 (12:12 +0200)
gettext-runtime/intl/ChangeLog
gettext-runtime/intl/explodename.c
gettext-runtime/intl/finddomain.c

index 56b6f2d1046cb524d8efb38dd55ef1bc678d0814..99a799833956d5ac196c0b9d47584abaadc13a77 100644 (file)
@@ -1,3 +1,14 @@
+2005-10-09  Bruno Haible  <bruno@clisp.org>
+2002-07-24  Ulrich Drepper  <drepper@redhat.com>
+
+       * explodename.c: Recognize the syntax
+         language[_territory][.codeset][@modifier]
+       instead of only
+         language[_territory[.codeset]][@modifier]
+       (_nl_find_language): Accept '.' as terminator.
+       (_nl_explode_name): Accept to parse a codeset without a territory.
+       Accept an underscore in the territory.
+
 2005-10-09  Bruno Haible  <bruno@clisp.org>
 2002-07-24  Ulrich Drepper  <drepper@redhat.com>
 
index a55e74d93915e0d06fbe2f41e7dae6d581a3e3b2..04f82bd44d19c6b4912357874cefd9b02c42b6af 100644 (file)
@@ -45,7 +45,7 @@ static char *_nl_find_language (const char *name);
 static char *
 _nl_find_language (const char *name)
 {
-  while (name[0] != '\0' && name[0] != '_' && name[0] != '@')
+  while (name[0] != '\0' && name[0] != '_' && name[0] != '@' && name[0] != '.')
     ++name;
 
   return (char *) name;
@@ -67,7 +67,7 @@ _nl_explode_name (char *name,
   *normalized_codeset = NULL;
 
   /* Now we determine the single parts of the locale name.  First
-     look for the language.  Termination symbols are `_' and `@'.  */
+     look for the language.  Termination symbols are `_', '.', and `@'.  */
   mask = 0;
   *language = cp = name;
   cp = _nl_find_language (*language);
@@ -76,16 +76,19 @@ _nl_explode_name (char *name,
     /* This does not make sense: language has to be specified.  Use
        this entry as it is without exploding.  Perhaps it is an alias.  */
     cp = strchr (*language, '\0');
-  else if (cp[0] == '_')
+  else
     {
-      /* Next is the territory.  */
-      cp[0] = '\0';
-      *territory = ++cp;
+      if (cp[0] == '_')
+       {
+         /* Next is the territory.  */
+         cp[0] = '\0';
+         *territory = ++cp;
 
-      while (cp[0] != '\0' && cp[0] != '.' && cp[0] != '@' && cp[0] != '_')
-       ++cp;
+         while (cp[0] != '\0' && cp[0] != '.' && cp[0] != '@')
+           ++cp;
 
-      mask |= XPG_TERRITORY;
+         mask |= XPG_TERRITORY;
+       }
 
       if (cp[0] == '.')
        {
index 320cb1056dd5eb9fad92212d3d240b02f7b4e525..237fe6ef5328b0e43abfe8a3e2f429bb90cb64a7 100644 (file)
@@ -68,7 +68,7 @@ _nl_find_domain (const char *dirname, char *locale,
 
   /* LOCALE can consist of up to four recognized parts for the XPG syntax:
 
-               language[_territory[.codeset]][@modifier]
+               language[_territory][.codeset][@modifier]
 
      Beside the first part all of them are allowed to be missing.  If
      the full specified locale is not found, the less specific one are
@@ -137,7 +137,7 @@ _nl_find_domain (const char *dirname, char *locale,
     }
 
   /* Now we determine the single parts of the locale name.  First
-     look for the language.  Termination symbols are `_' and `@'.  */
+     look for the language.  Termination symbols are `_', '.', and `@'.  */
   mask = _nl_explode_name (locale, &language, &modifier, &territory,
                           &codeset, &normalized_codeset);