X-Git-Url: https://pd.if.org/git/?p=pdclib.old;a=blobdiff_plain;f=functions%2Fwctype%2Ftowlower.c;h=b3def775b75b101992fc75752df8959c675e2b0e;hp=7f9809c32af356208ffe5743960a4e448c6f5cbb;hb=8208319e85b55e47e65de1c16d78681915057120;hpb=b641165a0d122178a33070e3434ab7b49397ad94 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