From 2f76d88d7dba542d15fce687b7d05ef026ab267b Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 10 Aug 2001 05:59:19 +0000 Subject: Update. * posix/fnmatch_loop.c: Fix computation of alignment. 2001-08-09 Isamu Hasegawa * posix/regex.c (wcs_regex_compile): Use appropriate string to compare with collating element. Fix the padding for the alignment. 2001-08-09 Isamu Hasegawa * locale/programs/ld-collate.c (collate_output): Exclude characters from elem_table. Reduce if clause to write collating elements correctly. * posix/Makefile (tests): Add bug-regex5. * posix/bug-regex5.c: New file. 2001-08-09 Ulrich Drepper --- locale/programs/ld-collate.c | 51 ++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 26 deletions(-) (limited to 'locale/programs') diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c index d19e3bb..e901558 100644 --- a/locale/programs/ld-collate.c +++ b/locale/programs/ld-collate.c @@ -2449,7 +2449,7 @@ collate_output (struct localedef_t *locale, struct charmap_t *charmap, runp = collate->start; while (runp != NULL) { - if (runp->mbs != NULL && runp->weights != NULL) + if (runp->mbs != NULL && runp->weights != NULL && !runp->is_character) { /* Compute the hash value of the name. */ uint32_t namelen = strlen (runp->name); @@ -2469,37 +2469,36 @@ collate_output (struct localedef_t *locale, struct charmap_t *charmap, idx -= elem_size; } while (elem_table[idx * 2] != 0); + } + /* This is the spot where we will insert the value. */ + elem_table[idx * 2] = hash; + elem_table[idx * 2 + 1] = obstack_object_size (&extrapool); - /* This is the spot where we will insert the value. */ - elem_table[idx * 2] = hash; - elem_table[idx * 2 + 1] = obstack_object_size (&extrapool); - - /* The the string itself including length. */ - obstack_1grow (&extrapool, namelen); - obstack_grow (&extrapool, runp->name, namelen); + /* The the string itself including length. */ + obstack_1grow (&extrapool, namelen); + obstack_grow (&extrapool, runp->name, namelen); - /* And the multibyte representation. */ - obstack_1grow (&extrapool, runp->nmbs); - obstack_grow (&extrapool, runp->mbs, runp->nmbs); + /* And the multibyte representation. */ + obstack_1grow (&extrapool, runp->nmbs); + obstack_grow (&extrapool, runp->mbs, runp->nmbs); - /* And align again to 32 bits. */ - if ((1 + namelen + 1 + runp->nmbs) % sizeof (int32_t) != 0) - obstack_grow (&extrapool, "\0\0", - (sizeof (int32_t) - - ((1 + namelen + 1 + runp->nmbs) - % sizeof (int32_t)))); + /* And align again to 32 bits. */ + if ((1 + namelen + 1 + runp->nmbs) % sizeof (int32_t) != 0) + obstack_grow (&extrapool, "\0\0", + (sizeof (int32_t) + - ((1 + namelen + 1 + runp->nmbs) + % sizeof (int32_t)))); - /* Now some 32-bit values: multibyte collation sequence, - wide char string (including length), and wide char - collation sequence. */ - obstack_int32_grow (&extrapool, runp->mbseqorder); + /* Now some 32-bit values: multibyte collation sequence, + wide char string (including length), and wide char + collation sequence. */ + obstack_int32_grow (&extrapool, runp->mbseqorder); - obstack_int32_grow (&extrapool, runp->nwcs); - obstack_grow (&extrapool, runp->wcs, - runp->nwcs * sizeof (uint32_t)); + obstack_int32_grow (&extrapool, runp->nwcs); + obstack_grow (&extrapool, runp->wcs, + runp->nwcs * sizeof (uint32_t)); - obstack_int32_grow (&extrapool, runp->wcseqorder); - } + obstack_int32_grow (&extrapool, runp->wcseqorder); } runp = runp->next; -- cgit v1.1