* locale/programs/ld-collate.c (collate_finish): Always define
	weight for UNDEFINED if not defined by the user but don't complain
	unless it is needed in the multibyte character table.
	(collate_output): Add extra dummy elements in wide char tables in the
	same way done for multibyte.  Always output undefined entry in
	wide character table.

	Contributed by Richard Henderson, Jakub Jelinek and others.
This commit is contained in:
Ulrich Drepper 1999-12-30 18:12:52 +00:00
parent cd7de27bf3
commit 3ac4f91b92
2 changed files with 42 additions and 8 deletions

View File

@ -1,5 +1,12 @@
1999-12-30 Ulrich Drepper <drepper@cygnus.com>
* locale/programs/ld-collate.c (collate_finish): Always define
weight for UNDEFINED if not defined by the user but don't complain
unless it is needed in the multibyte character table.
(collate_output): Add extra dummy elements in wide char tables in the
same way done for multibyte. Always output undefined entry in
wide character table.
* locale/Makefile (categories): Remove commented-out old definition.
* locale/programs/ld-collate.c (insert_value): Don't pass wide string

View File

@ -1717,7 +1717,9 @@ Computing table size for collation table might take a while..."),
/* Now determine whether the UNDEFINED entry is needed and if yes,
whether it was defined. */
collate->undefined.used_in_level = need_undefined ? ~0ul : 0;
if (need_undefined && collate->undefined.file == NULL)
if (collate->undefined.file == NULL)
{
if (need_undefined)
{
error (0, 0, _("no definition of `UNDEFINED'"));
@ -1727,7 +1729,12 @@ Computing table size for collation table might take a while..."),
for (i = 0; i < nrules; ++i)
collate->undefined.mborder[i] = mbact[i]++;
}
/* In any case we will need the definition for the wide character
case. But we will not complain that it is missing since the
specification strangely enough does not seem to account for
this. */
collate->undefined.wcorder = wcact++;
}
@ -2179,6 +2186,26 @@ collate_output (struct localedef_t *locale, struct charmap_t *charmap,
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
++cnt;
/* Since we are using the sign of an integer to mark indirection the
offsets in the arrays we are indirectly referring to must not be
zero since -0 == 0. Therefore we add a bit of dummy content. */
if (sizeof (int) == sizeof (int32_t))
{
obstack_int_grow (&extrapool, 0);
obstack_int_grow (&indirectpool, 0);
}
else
{
int32_t zero = 0;
obstack_grow (&extrapool, &zero, sizeof (zero));
obstack_grow (&indirectpool, &zero, sizeof (zero));
}
/* Now insert the `UNDEFINED' value if it is used. Since this value
will probably be used more than once it is good to store the
weights only once. */
output_weightwc (&weightpool, collate, &collate->undefined);
/* Generate the table. Walk through the lists of sequences
starting with the same byte and add them one after the other to
the table. In case we have more than one sequence starting with