From bece1bc4ec83cde611243c891d3a93b5e9bbcedd Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 20 Nov 1999 23:27:27 +0000 Subject: [PATCH] Update. * wctype/wctrans.c (wctrans): Use correct base index to access extra mapping tables. * locale/loadlocale.c (_nl_load_locale): Use actual number of entries from file and not the fixed (minimal number from the langinfo.h list. --- ChangeLog | 7 +++++++ locale/loadlocale.c | 5 ++--- wctype/wctrans.c | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d2c0dea..48a033e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 1999-11-20 Ulrich Drepper + * wctype/wctrans.c (wctrans): Use correct base index to access + extra mapping tables. + + * locale/loadlocale.c (_nl_load_locale): Use actual number of + entries from file and not the fixed (minimal number from the + langinfo.h list. + * locale/programs/ld-ctype.c (ctype_read): Fix reading of values in charmaps. diff --git a/locale/loadlocale.c b/locale/loadlocale.c index d829309..7b94a42 100644 --- a/locale/loadlocale.c +++ b/locale/loadlocale.c @@ -176,8 +176,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category) } newdata = malloc (sizeof *newdata - + (_nl_category_num_items[category] - * sizeof (union locale_data_value))); + + filedata->nstrings * sizeof (union locale_data_value)); if (! newdata) goto puntmap; @@ -186,7 +185,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category) newdata->filesize = st.st_size; newdata->mmaped = mmaped; newdata->usage_count = 0; - newdata->nstrings = _nl_category_num_items[category]; + newdata->nstrings = filedata->nstrings; for (cnt = 0; cnt < newdata->nstrings; ++cnt) { off_t idx = filedata->strindex[cnt]; diff --git a/wctype/wctrans.c b/wctype/wctrans.c index 3c46131..a5b4a32 100644 --- a/wctype/wctrans.c +++ b/wctype/wctrans.c @@ -50,7 +50,7 @@ wctrans (const char *property) return (wctrans_t) __ctype_tolower; /* We have to search the table. */ - result = (int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_WIDTH + cnt - 2); + result = (int32_t *) _NL_CURRENT (LC_CTYPE, _NL_NUM_LC_CTYPE + cnt - 2); return (wctrans_t) (result + 128); } -- 2.7.4