From 8114530a31e03aec4085f79971c2a3b9e940eae3 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 17 Jul 2000 22:09:30 +0000 Subject: Update. 2000-07-17 Bruno Haible * iconv/gconv_open.c (__gconv_open): Initialize the __data field of struct __gconv_trans_data differently. Don't pass NULL to trans_init_fct. Simplify list append operation. 2000-07-14 Bruno Haible * intl/dcigettext.c (dcigettext): Call plural_eval on all platforms, not only those having tsearch. 2000-07-17 Ulrich Drepper * locale/langinfo.h: Add placeholder values in enum for removed LC_CTYPE entries. 2000-07-17 Jakub Jelinek * elf/dl-addr.c (_dl_addr): Keep searching in the _dl_loaded chain if the PHDR check fails. 2000-07-17 Mark Kettenis * nss/getent.c (print_hosts): Make sure we always print a space between numeric addresses and hostnames. 2000-07-17 Wolfram Gloger * malloc/malloc.c (chunk_alloc): Use mmap_chunk() only if allowed, i.e. if n_mmaps_max>0. 2000-07-16 Mark Kettenis * resolv/netdb.h (AI_V4MAPPED, AI_ALL, AI_ADDRCONFIG): Adjust values to remove possible clash with other AI_* constants. (AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST): Define as hexadecimal constants to stress the fact they're in fact bit flags. 2000-07-15 Mark Kettenis * nss/getXXent_r.c [NEED__RES]: Include . (SETFUNC_NAME, ENDFUNC_NAME, REENTRANT_GETNAME): Use res_ninit instead of res_init. --- intl/dcigettext.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'intl/dcigettext.c') diff --git a/intl/dcigettext.c b/intl/dcigettext.c index ed470b4ee6..fcbc130a26 100644 --- a/intl/dcigettext.c +++ b/intl/dcigettext.c @@ -553,24 +553,25 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category) if (domain != NULL) { unsigned long int index = 0; -#if defined HAVE_TSEARCH || defined _LIBC - struct loaded_domain *domaindata = - (struct loaded_domain *) domain->data; if (plural != 0) { + struct loaded_domain *domaindata = + (struct loaded_domain *) domain->data; + index = plural_eval (domaindata->plural, n); + if (index >= domaindata->nplurals) + /* This should never happen. It means the plural expression + and the given maximum value do not match. */ + index = 0; + +#if defined HAVE_TSEARCH || defined _LIBC /* Try to find the translation among those which we found at some time. */ search = (struct known_translation_t *) alloca (sizeof (*search) + msgid_len); memcpy (search->msgid, msgid1, msgid_len); search->domain = (char *) domainname; - search->plindex = plural_eval (domaindata->plural, n); - if (search->plindex >= domaindata->nplurals) - /* This should never happen. It means the plural expression - and the given maximum value do not match. */ - search->plindex = 0; - index = search->plindex; + search->plindex = index; search->category = category; foundp = (struct known_translation_t **) tfind (search, &root, @@ -580,8 +581,8 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category) __libc_rwlock_unlock (_nl_state_lock); return (char *) (*foundp)->translation; } - } #endif + } retval = _nl_find_msg (domain, msgid1, index); -- cgit v1.2.3