aboutsummaryrefslogtreecommitdiff
path: root/locale
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 /locale
parente48492aebc516d7a615e155e2ba5f4ce28225da0 (diff)
downloadglibc-96f0d1f51afc733684c3a5abbdf242cd3347c185.zip
glibc-96f0d1f51afc733684c3a5abbdf242cd3347c185.tar.gz
glibc-96f0d1f51afc733684c3a5abbdf242cd3347c185.tar.bz2
Update.
* locale/programs/ld-ctype.c (set_class_defaults): Set default value for alpha and alnum correctly.
Diffstat (limited to 'locale')
-rw-r--r--locale/programs/ld-ctype.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c
index 6378c13..2f99cf8 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)