]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Integrate glibc 2.2 -> glibc 2.2.1 changes.
authorBruno Haible <bruno@clisp.org>
Wed, 17 Jan 2001 17:34:02 +0000 (17:34 +0000)
committerBruno Haible <bruno@clisp.org>
Wed, 17 Jan 2001 17:34:02 +0000 (17:34 +0000)
intl/ChangeLog
intl/dcigettext.c
intl/loadmsgcat.c
intl/locale.alias
intl/plural.y

index 18f2b6b3b464f2330e4daf7649184586e6c5f992..821b7ee028b745959ee46339f765daf194837166 100644 (file)
@@ -1,3 +1,23 @@
+2001-01-04  Ulrich Drepper  <drepper@redhat.com>
+
+       * plural.y (yylex): Minimal improvement in number scanner.
+
+2001-01-02  Ulrich Drepper  <drepper@redhat.com>
+
+       * dcigettext.c (guess_category_value): Rewrite so that LANGUAGE value
+       is ignored if the selected locale is the C locale.
+
+2000-11-20  Ulrich Drepper  <drepper@redhat.com>
+
+       * dcigettext.c (transcmp): Make s1 and s2 const.
+       * loadmsgcat.c (_nl_load_domain): Rearrange domain initialization to
+       avoid warning.
+
+2000-11-09  Ulrich Drepper  <drepper@redhat.com>
+
+       * locale.alias: Add thai.
+       Patch by Chanop Silpa-Anan <chanop@syseng.anu.edu.au>.
+
 2001-01-05  Bruno Haible  <haible@clisp.cons.org>
 
        * Makefile.in (INCLUDES): Remove reference to $(top_srcdir)/lib.
index 72bfbfc47b98d9195bffe801141cbd775efdcb57..545a12fdcada4aa615e8f90a9a1410ab6db6499b 100644 (file)
@@ -244,10 +244,13 @@ transcmp (p1, p2)
      const void *p1;
      const void *p2;
 {
-  struct known_translation_t *s1 = (struct known_translation_t *) p1;
-  struct known_translation_t *s2 = (struct known_translation_t *) p2;
+  const struct known_translation_t *s1;
+  const struct known_translation_t *s2;
   int result;
 
+  s1 = (const struct known_translation_t *) p1;
+  s2 = (const struct known_translation_t *) p2;
+
   result = strcmp (s1->msgid, s2->msgid);
   if (result == 0)
     {
@@ -1087,39 +1090,41 @@ guess_category_value (category, categoryname)
      int category;
      const char *categoryname;
 {
+  const char *language;
   const char *retval;
 
   /* The highest priority value is the `LANGUAGE' environment
-     variable.  This is a GNU extension.  */
-  retval = getenv ("LANGUAGE");
-  if (retval != NULL && retval[0] != '\0')
-    return retval;
-
-  /* `LANGUAGE' is not set.  So we have to proceed with the POSIX
-     methods of looking to `LC_ALL', `LC_xxx', and `LANG'.  On some
-     systems this can be done by the `setlocale' function itself.  */
+     variable.  But we don't use the value if the currently selected
+     locale is the C locale.  This is a GNU extension.  */
+  language = getenv ("LANGUAGE");
+  if (language != NULL && language[0] == '\0')
+    language = NULL;
+
+  /* We have to proceed with the POSIX methods of looking to `LC_ALL',
+     `LC_xxx', and `LANG'.  On some systems this can be done by the
+     `setlocale' function itself.  */
 #if defined _LIBC || (defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL)
-  return setlocale (category, NULL);
+  retval = setlocale (category, NULL);
 #else
   /* Setting of LC_ALL overwrites all other.  */
   retval = getenv ("LC_ALL");
-  if (retval != NULL && retval[0] != '\0')
-    return retval;
-
-  /* Next comes the name of the desired category.  */
-  retval = getenv (categoryname);
-  if (retval != NULL && retval[0] != '\0')
-    return retval;
-
-  /* Last possibility is the LANG environment variable.  */
-  retval = getenv ("LANG");
-  if (retval != NULL && retval[0] != '\0')
-    return retval;
-
-  /* We use C as the default domain.  POSIX says this is implementation
-     defined.  */
-  return "C";
+  if (retval == NULL || retval[0] == '\0')
+    {
+      /* Next comes the name of the desired category.  */
+      retval = getenv (categoryname);
+      if (retval == NULL || retval[0] == '\0')
+       {
+         /* Last possibility is the LANG environment variable.  */
+         retval = getenv ("LANG");
+         if (retval == NULL || retval[0] == '\0')
+           /* We use C as the default domain.  POSIX says this is
+              implementation defined.  */
+           return "C";
+       }
+    }
 #endif
+
+  return language != NULL && strcmp (retval, "C") != 0 ? language : retval;
 }
 
 /* @@ begin of epilog @@ */
index 3bbb3543941b5b788af4774b7b61ac8d5c4ea347..6462daa2c169327860c875d91563eda3a807522e 100644 (file)
@@ -132,14 +132,15 @@ static struct expression germanic_plural =
   .operation = not_equal,
   .val =
   {
-    .args2 = {
+    .args2 =
+    {
       .left = (struct expression *) &plvar,
       .right = (struct expression *) &plone
     }
   }
 };
 
-#define INIT_GERMANIC_PLURAL()
+# define INIT_GERMANIC_PLURAL()
 
 #else
 
@@ -166,7 +167,7 @@ init_germanic_plural ()
     }
 }
 
-#define INIT_GERMANIC_PLURAL() init_germanic_plural ()
+# define INIT_GERMANIC_PLURAL() init_germanic_plural ()
 
 #endif
 
@@ -283,12 +284,11 @@ _nl_load_domain (domain_file)
       return;
     }
 
-  domain_file->data
-    = (struct loaded_domain *) malloc (sizeof (struct loaded_domain));
-  if (domain_file->data == NULL)
+  domain = (struct loaded_domain *) malloc (sizeof (struct loaded_domain));
+  if (domain == NULL)
     return;
+  domain_file->data = domain;
 
-  domain = (struct loaded_domain *) domain_file->data;
   domain->data = (char *) data;
   domain->use_mmap = use_mmap;
   domain->mmap_size = size;
index 927a10cf6dfcfd7863e4a6b01c72a489e185fdc9..ef5aa47765877b184dda9b980943c7b9b56e11a8 100644 (file)
@@ -72,4 +72,5 @@ slovene         sl_SI.ISO-8859-2
 slovenian       sl_SI.ISO-8859-2
 spanish         es_ES.ISO-8859-1
 swedish         sv_SE.ISO-8859-1
+thai           th_TH.TIS-620
 turkish         tr_TR.ISO-8859-9
index 77a27230794ec064eed518bf3c9c54de5addfe20..1f7fb6cf14cff751acadbb402af457fdc0391f31 100644 (file)
@@ -273,7 +273,7 @@ yylex (lval, pexp)
     case '0': case '1': case '2': case '3': case '4':
     case '5': case '6': case '7': case '8': case '9':
       {
-       unsigned long int n = exp[-1] - '0';
+       unsigned long int n = result - '0';
        while (exp[0] >= '0' && exp[0] <= '9')
          {
            n *= 10;