X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fwctype%2Ftowupper.c;h=e9f99a54380791176a7a47dba0db075e6af1409a;hb=abe63836320730ecf705e5da9c140db4c216cd2c;hp=faac657501cac24ec24b262673befcdb97f5713f;hpb=75bf0c22663cec60d8164c8cf77e855a8b6ad459;p=pdclib 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