aboutsummaryrefslogtreecommitdiff
path: root/locale/programs/ld-collate.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-12-26 08:47:27 +0000
committerUlrich Drepper <drepper@redhat.com>1999-12-26 08:47:27 +0000
commitf6ada7adcbb56e73ee3a168a515f9b5cbe179611 (patch)
tree1f246c1d8c148411d4b4db13f3d642aa9e815fac /locale/programs/ld-collate.c
parent5358d026c74d1227271c190f0070fc90ef789829 (diff)
downloadglibc-f6ada7adcbb56e73ee3a168a515f9b5cbe179611.tar
glibc-f6ada7adcbb56e73ee3a168a515f9b5cbe179611.tar.gz
glibc-f6ada7adcbb56e73ee3a168a515f9b5cbe179611.tar.bz2
glibc-f6ada7adcbb56e73ee3a168a515f9b5cbe179611.zip
Update.
1999-12-26 Ulrich Drepper <drepper@cygnus.com> * tst-trans.sh: Use correct name for dynamic loader.
Diffstat (limited to 'locale/programs/ld-collate.c')
-rw-r--r--locale/programs/ld-collate.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c
index c4ffd2b831..cd373d5238 100644
--- a/locale/programs/ld-collate.c
+++ b/locale/programs/ld-collate.c
@@ -1376,6 +1376,14 @@ collate_finish (struct localedef_t *locale, struct charmap_t *charmap)
struct section_list *sect;
int ruleidx;
+ if (collate == NULL)
+ {
+ /* No data, no check. */
+ if (! be_quiet)
+ error (0, 0, _("No definition for %s category found"), "LC_COLLATE");
+ return;
+ }
+
/* If this assertion is hit change the type in `element_t'. */
assert (nrules <= sizeof (runp->used_in_level) * 8);
@@ -1624,10 +1632,6 @@ collate_output (struct localedef_t *locale, struct charmap_t *charmap,
struct section_list *sect;
int i;
- obstack_init (&weightpool);
- obstack_init (&extrapool);
- obstack_init (&indirectpool);
-
data.magic = LIMAGIC (LC_COLLATE);
data.n = nelems;
iov[0].iov_base = (void *) &data;
@@ -1645,6 +1649,28 @@ collate_output (struct localedef_t *locale, struct charmap_t *charmap,
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
++cnt;
+ /* If we have no LC_COLLATE data emit only the number of rules as zero. */
+ if (collate == NULL)
+ {
+ while (cnt < _NL_ITEM_INDEX (_NL_NUM_LC_COLLATE))
+ {
+ iov[2 + cnt].iov_base = (char *) "";
+ iov[2 + cnt].iov_len = 0;
+ idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
+ ++cnt;
+ }
+
+ assert (cnt == _NL_ITEM_INDEX (_NL_NUM_LC_COLLATE));
+
+ write_locale_data (output_path, "LC_COLLATE", 2 + cnt, iov);
+
+ return;
+ }
+
+ obstack_init (&weightpool);
+ obstack_init (&extrapool);
+ obstack_init (&indirectpool);
+
/* Prepare the ruleset table. */
for (sect = collate->sections, i = 0; sect != NULL; sect = sect->next)
if (sect->ruleidx == i)