From: Bruno Haible Date: Wed, 17 Jan 2001 17:34:02 +0000 (+0000) Subject: Integrate glibc 2.2 -> glibc 2.2.1 changes. X-Git-Tag: v0.10.36~187 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d47dbeefc2320f17ee2c819d6b79abe4427bc15;p=thirdparty%2Fgettext.git Integrate glibc 2.2 -> glibc 2.2.1 changes. --- diff --git a/intl/ChangeLog b/intl/ChangeLog index 18f2b6b3b..821b7ee02 100644 --- a/intl/ChangeLog +++ b/intl/ChangeLog @@ -1,3 +1,23 @@ +2001-01-04 Ulrich Drepper + + * plural.y (yylex): Minimal improvement in number scanner. + +2001-01-02 Ulrich Drepper + + * 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 + + * dcigettext.c (transcmp): Make s1 and s2 const. + * loadmsgcat.c (_nl_load_domain): Rearrange domain initialization to + avoid warning. + +2000-11-09 Ulrich Drepper + + * locale.alias: Add thai. + Patch by Chanop Silpa-Anan . + 2001-01-05 Bruno Haible * Makefile.in (INCLUDES): Remove reference to $(top_srcdir)/lib. diff --git a/intl/dcigettext.c b/intl/dcigettext.c index 72bfbfc47..545a12fdc 100644 --- a/intl/dcigettext.c +++ b/intl/dcigettext.c @@ -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 @@ */ diff --git a/intl/loadmsgcat.c b/intl/loadmsgcat.c index 3bbb35439..6462daa2c 100644 --- a/intl/loadmsgcat.c +++ b/intl/loadmsgcat.c @@ -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; diff --git a/intl/locale.alias b/intl/locale.alias index 927a10cf6..ef5aa4776 100644 --- a/intl/locale.alias +++ b/intl/locale.alias @@ -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 diff --git a/intl/plural.y b/intl/plural.y index 77a272307..1f7fb6cf1 100644 --- a/intl/plural.y +++ b/intl/plural.y @@ -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;