X-Git-Url: https://pd.if.org/git/?p=pdclib.old;a=blobdiff_plain;f=functions%2Fwctype%2Ftowupper.c;h=e9f99a54380791176a7a47dba0db075e6af1409a;hp=faac657501cac24ec24b262673befcdb97f5713f;hb=8208319e85b55e47e65de1c16d78681915057120;hpb=b641165a0d122178a33070e3434ab7b49397ad94 diff --git a/functions/wctype/towupper.c b/functions/wctype/towupper.c index faac657..e9f99a5 100644 --- a/functions/wctype/towupper.c +++ b/functions/wctype/towupper.c @@ -8,15 +8,20 @@ #ifndef REGTEST #include <_PDCLIB_locale.h> -wint_t towupper( wint_t wc ) +wint_t _PDCLIB_towupper_l( wint_t wc, locale_t l ) { wint_t uwc = _PDCLIB_unpackwint( wc ); - _PDCLIB_wcinfo_t *info = _PDCLIB_wcgetinfo( uwc ); - if( info && info->upper != uwc ) + _PDCLIB_wcinfo_t *info = _PDCLIB_wcgetinfo( l, uwc ); + if( info ) { - wc = info->upper; + uwc += info->upper_delta; } - return wc; + return uwc; +} + +wint_t towupper( wint_t wc ) +{ + return _PDCLIB_towupper_l( wc, _PDCLIB_threadlocale() ); } #endif