summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-11-16 23:00:29 +0000
committerUlrich Drepper <drepper@redhat.com>1999-11-16 23:00:29 +0000
commit96f0d1f51afc733684c3a5abbdf242cd3347c185 (patch)
tree2654d6710dfe7404e167125493b1db3fb5d2a7d9
parente48492aebc516d7a615e155e2ba5f4ce28225da0 (diff)
downloadglibc-96f0d1f51afc733684c3a5abbdf242cd3347c185.tar.gz
glibc-96f0d1f51afc733684c3a5abbdf242cd3347c185.tar.xz
glibc-96f0d1f51afc733684c3a5abbdf242cd3347c185.zip
Update.
	* locale/programs/ld-ctype.c (set_class_defaults): Set default
	value for alpha and alnum correctly.
-rw-r--r--ChangeLog3
-rw-r--r--locale/programs/ld-ctype.c18
2 files changed, 17 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 7039791bc3..6379dce139 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 1999-11-16  Ulrich Drepper  <drepper@cygnus.com>
 
+	* locale/programs/ld-ctype.c (set_class_defaults): Set default
+	value for alpha and alnum correctly.
+
 	* locale/programs/ld-address.c (address_output): Fix output of
 	country_num.
 
diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c
index 6378c131bf..2f99cf8dfc 100644
--- a/locale/programs/ld-ctype.c
+++ b/locale/programs/ld-ctype.c
@@ -2308,10 +2308,15 @@ set_class_defaults (struct locale_ctype_t *ctype, struct charmap_t *charmap,
       /* Table 2-6 in P1003.2 says that characters in class `upper' or
 	 class `lower' *must* be in class `alpha'.  */
       unsigned long int mask = BIT (tok_upper) | BIT (tok_lower);
+      unsigned long int maskw = BITw (tok_upper) | BITw (tok_lower);
+
+      for (cnt = 0; cnt < 256; ++cnt)
+	if ((ctype->class256_collection[cnt] & mask) != 0)
+	  ctype->class256_collection[cnt] |= BIT (tok_alpha);
 
       for (cnt = 0; cnt < ctype->class_collection_act; ++cnt)
-	if ((ctype->class_collection[cnt] & mask) != 0)
-	  ctype->class_collection[cnt] |= BIT (tok_alpha);
+	if ((ctype->class_collection[cnt] & maskw) != 0)
+	  ctype->class_collection[cnt] |= BITw (tok_alpha);
     }
 
   if ((ctype->class_done & BITw (tok_digit)) == 0)
@@ -2325,10 +2330,15 @@ set_class_defaults (struct locale_ctype_t *ctype, struct charmap_t *charmap,
      and `digit' are automatically included in this class.  */
   {
     unsigned long int mask = BIT (tok_alpha) | BIT (tok_digit);
+    unsigned long int maskw = BITw (tok_alpha) | BITw (tok_digit);
+
+    for (cnt = 0; cnt < 256; ++cnt)
+      if ((ctype->class256_collection[cnt] & mask) != 0)
+	ctype->class256_collection[cnt] |= BIT (tok_alnum);
 
     for (cnt = 0; cnt < ctype->class_collection_act; ++cnt)
-      if ((ctype->class_collection[cnt] & mask) != 0)
-	ctype->class_collection[cnt] |= BIT (tok_alnum);
+      if ((ctype->class_collection[cnt] & maskw) != 0)
+	ctype->class_collection[cnt] |= BITw (tok_alnum);
   }
 
   if ((ctype->class_done & BITw (tok_space)) == 0)