From a686d047d79bdfc37c096a4fa350c37e4ccf3cf5 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Mon, 3 Jun 2024 13:56:25 -0400 Subject: 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() --- src/wctype/wctrans.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/wctype/wctrans.c') diff --git a/src/wctype/wctrans.c b/src/wctype/wctrans.c index aa47d945..7f724d27 100644 --- a/src/wctype/wctrans.c +++ b/src/wctype/wctrans.c @@ -7,11 +7,12 @@ wctrans_t wctrans(const char * property) { SIGNAL_SAFE(0); ASSERT_NONNULL(property); + wctrans_t epoch = __get_locale()->ctype_epoch << CT_EPOCH_SHIFT; if (!strcmp(property, "tolower")) { - return CT_LOWER; + return epoch | CT_LOWER; } else if (!strcmp(property, "toupper")) { - return CT_UPPER; + return epoch | CT_UPPER; } return 0; -- cgit v1.2.1