diff options
| author | Jakob Kaivo <jkk@ung.org> | 2024-06-03 13:56:25 -0400 |
|---|---|---|
| committer | Jakob Kaivo <jkk@ung.org> | 2024-06-03 13:56:25 -0400 |
| commit | a686d047d79bdfc37c096a4fa350c37e4ccf3cf5 (patch) | |
| tree | ca631b9095454a239211b6f676bdd3e0cb102156 /src/wctype/towctrans.c | |
| parent | c575f269ed4a04f89d610b423cc43ce7bd6f008b (diff) | |
add LC_CTYPE epoch and use separate CT_ categories and CTM_ masks to support detecting change of LC_CTYPE between calls to wctype()/iswctype() and wctrans()/towctrans()
Diffstat (limited to 'src/wctype/towctrans.c')
| -rw-r--r-- | src/wctype/towctrans.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wctype/towctrans.c b/src/wctype/towctrans.c index 8e6d266c..4dccfa64 100644 --- a/src/wctype/towctrans.c +++ b/src/wctype/towctrans.c @@ -8,6 +8,10 @@ wint_t towctrans(wint_t wc, wctrans_t desc) ASSERT_REPRESENTABLE(wc, WCHAR_MIN, WCHAR_MAX, "wchar_t", WEOF); //ASSERT_REPRESENTABLE(desc, 1, __libc.wctype.nwctrans, "wctrans_t", 0); + if (__get_locale()->ctype_epoch != (desc >> CT_EPOCH_SHIFT)) { + UNDEFINED("LC_CTYPE has changed since the call to wctrans()"); + } + /* TODO: actual work */ (void)wc; (void)desc; |
