wctype: have towlower and towupper check char ranges with no locale backend.
Change-Id: Ie63977bcf54ce9b0a2fa542ba5327c8e8b050e2e Reviewed-on: https://review.haiku-os.org/740 Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
bc6fcc8aae
commit
9f4b382338
@@ -123,8 +123,11 @@ iswxdigit(wint_t wc)
|
||||
wint_t
|
||||
towlower(wint_t wc)
|
||||
{
|
||||
if (gLocaleBackend == NULL)
|
||||
if (gLocaleBackend == NULL) {
|
||||
if (wc < 0 || wc > 127)
|
||||
return wc;
|
||||
return tolower(wc);
|
||||
}
|
||||
|
||||
wint_t result = wc;
|
||||
gLocaleBackend->ToWCTrans(wc, _ISlower, result);
|
||||
@@ -136,8 +139,11 @@ towlower(wint_t wc)
|
||||
wint_t
|
||||
towupper(wint_t wc)
|
||||
{
|
||||
if (gLocaleBackend == NULL)
|
||||
if (gLocaleBackend == NULL) {
|
||||
if (wc < 0 || wc > 127)
|
||||
return wc;
|
||||
return toupper(wc);
|
||||
}
|
||||
|
||||
wint_t result = wc;
|
||||
gLocaleBackend->ToWCTrans(wc, _ISupper, result);
|
||||
|
||||
Reference in New Issue
Block a user