X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fwctype%2Ftowlower.c;h=b3def775b75b101992fc75752df8959c675e2b0e;hb=abe63836320730ecf705e5da9c140db4c216cd2c;hp=7f9809c32af356208ffe5743960a4e448c6f5cbb;hpb=75bf0c22663cec60d8164c8cf77e855a8b6ad459;p=pdclib diff --git a/functions/wctype/towlower.c b/functions/wctype/towlower.c index 7f9809c..b3def77 100644 --- a/functions/wctype/towlower.c +++ b/functions/wctype/towlower.c @@ -8,15 +8,20 @@ #ifndef REGTEST #include <_PDCLIB_locale.h> -wint_t towlower( wint_t wc ) +wint_t _PDCLIB_towlower_l( wint_t wc, locale_t l ) { wint_t uwc = _PDCLIB_unpackwint( wc ); - _PDCLIB_wcinfo_t *info = _PDCLIB_wcgetinfo( uwc ); - if( info && info->lower != uwc ) + _PDCLIB_wcinfo_t *info = _PDCLIB_wcgetinfo( l, uwc ); + if( info ) { - wc = info->lower; + uwc += info->lower_delta; } - return wc; + return uwc; +} + +wint_t towlower( wint_t wc ) +{ + return _PDCLIB_towlower_l( wc, _PDCLIB_threadlocale() ); } #endif