about summary refs log tree commit diff
path: root/locale/programs/ld-collate.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-01-25 01:00:37 +0000
committerUlrich Drepper <drepper@redhat.com>2000-01-25 01:00:37 +0000
commitdb76d9433c8b71eb3677ff5ca5b94e084e73e468 (patch)
treeb02fb38974b74d7711821b95e94e798e1e67db53 /locale/programs/ld-collate.c
parent973209d8b04730a5f39dbcb015cc9836add665c1 (diff)
downloadglibc-db76d9433c8b71eb3677ff5ca5b94e084e73e468.tar.gz
glibc-db76d9433c8b71eb3677ff5ca5b94e084e73e468.tar.xz
glibc-db76d9433c8b71eb3677ff5ca5b94e084e73e468.zip
Update.
	* locale/programs/ld-collate.c (collate_output): Also handle
	IGNOREd characters in the simple way when generating the multibyte
	table.

	* locale/programs/ld-ctype.c (allocate_arrays): Move codeset_name
	handling to ...
	(ctype_finish): ...here.  Check for missing codeset name.
Diffstat (limited to 'locale/programs/ld-collate.c')
-rw-r--r--locale/programs/ld-collate.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c
index 226bf23b4a..eb0c55ee63 100644
--- a/locale/programs/ld-collate.c
+++ b/locale/programs/ld-collate.c
@@ -2000,7 +2000,7 @@ collate_output (struct localedef_t *locale, struct charmap_t *charmap,
 
   for (ch = 1; ch < 256; ++ch)
     if (collate->mbheads[ch]->mbnext == NULL
-	&& collate->mbheads[ch]->nmbs == 1)
+	&& collate->mbheads[ch]->nmbs <= 1)
       {
 	tablemb[ch] = output_weight (&weightpool, collate,
 				     collate->mbheads[ch]);
@@ -2025,6 +2025,9 @@ collate_output (struct localedef_t *locale, struct charmap_t *charmap,
 	struct element_t *runp = collate->mbheads[ch];
 	struct element_t *lastp;
 
+	assert ((obstack_object_size (&extrapool)
+		 & (__alignof__ (int32_t) - 1)) == 0);
+
 	tablemb[ch] = -obstack_object_size (&extrapool);
 
 	do
@@ -2081,6 +2084,7 @@ collate_output (struct localedef_t *locale, struct charmap_t *charmap,
 		/* Now walk backward from here to the beginning.  */
 		curp = runp;
 
+		assert (runp->nmbs <= 256);
 		obstack_1grow_fast (&extrapool, curp->nmbs - 1);
 		for (i = 1; i < curp->nmbs; ++i)
 		  obstack_1grow_fast (&extrapool, curp->mbs[i]);
@@ -2125,13 +2129,17 @@ collate_output (struct localedef_t *locale, struct charmap_t *charmap,
 		added = ((sizeof (int32_t) + 1 + runp->nmbs - 1
 			  + __alignof__ (int32_t) - 1)
 			 & ~(__alignof__ (int32_t) - 1));
+		assert ((obstack_object_size (&extrapool)
+			 & (__alignof__ (int32_t) - 1)) == 0);
 		obstack_make_room (&extrapool, added);
 
 		if (sizeof (int32_t) == sizeof (int))
 		  obstack_int_grow_fast (&extrapool, weightidx);
 		else
 		  obstack_grow (&extrapool, &weightidx, sizeof (int32_t));
+		assert (runp->nmbs <= 256);
 		obstack_1grow_fast (&extrapool, runp->nmbs - 1);
+
 		for (i = 1; i < runp->nmbs; ++i)
 		  obstack_1grow_fast (&extrapool, runp->mbs[i]);
 	      }
@@ -2147,11 +2155,14 @@ collate_output (struct localedef_t *locale, struct charmap_t *charmap,
 	  }
 	while (runp != NULL);
 
+	assert ((obstack_object_size (&extrapool)
+		 & (__alignof__ (int32_t) - 1)) == 0);
+
 	/* If the final entry in the list is not a single character we
            add an UNDEFINED entry here.  */
 	if (lastp->nmbs != 1)
 	  {
-	    int added = ((sizeof (int32_t) + 1 + 1 + __alignof__ (int32_t))
+	    int added = ((sizeof (int32_t) + 1 + 1 + __alignof__ (int32_t) - 1)
 			 & ~(__alignof__ (int32_t) - 1));
 	    obstack_make_room (&extrapool, added);