diff options
author | Ulrich Drepper <drepper@redhat.com> | 1999-11-16 23:00:29 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1999-11-16 23:00:29 +0000 |
commit | 96f0d1f51afc733684c3a5abbdf242cd3347c185 (patch) | |
tree | 2654d6710dfe7404e167125493b1db3fb5d2a7d9 /locale/programs/ld-ctype.c | |
parent | e48492aebc516d7a615e155e2ba5f4ce28225da0 (diff) | |
download | glibc-96f0d1f51afc733684c3a5abbdf242cd3347c185.tar glibc-96f0d1f51afc733684c3a5abbdf242cd3347c185.tar.gz glibc-96f0d1f51afc733684c3a5abbdf242cd3347c185.tar.bz2 glibc-96f0d1f51afc733684c3a5abbdf242cd3347c185.zip |
Update.
* locale/programs/ld-ctype.c (set_class_defaults): Set default
value for alpha and alnum correctly.
Diffstat (limited to 'locale/programs/ld-ctype.c')
-rw-r--r-- | locale/programs/ld-ctype.c | 18 |
1 files changed, 14 insertions, 4 deletions
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) |