Fix iswlower/iswupper.

The previous conditions were just plain wrong.

Test: bionic tests
Change-Id: Ia6d98207b1ff98ea4c6f619912e4bcdb8a7fdd24
This commit is contained in:
Elliott Hughes 2016-11-16 15:19:08 -08:00
parent 8945d5e43a
commit f76a21a185
1 changed files with 6 additions and 2 deletions

View File

@ -40,8 +40,12 @@ int iswalnum(wint_t wc) { return iswdigit(wc) || iswalpha(wc); }
int iswblank(wint_t wc) { return isblank(wc); } int iswblank(wint_t wc) { return isblank(wc); }
int iswdigit(wint_t wc) { return isdigit(wc); } int iswdigit(wint_t wc) { return isdigit(wc); }
int iswgraph(wint_t wc) { return !iswspace(wc) && iswprint(wc); } int iswgraph(wint_t wc) { return !iswspace(wc) && iswprint(wc); }
int iswlower(wint_t wc) { return towlower(wc) != wc; } int iswlower(wint_t wc) {
int iswupper(wint_t wc) { return towupper(wc) != wc; } return towlower(wc) == wc && !(iswcntrl(wc) || iswdigit(wc) || iswpunct(wc) || iswspace(wc));
}
int iswupper(wint_t wc) {
return towupper(wc) == wc && !(iswcntrl(wc) || iswdigit(wc) || iswpunct(wc) || iswspace(wc));
}
int iswxdigit(wint_t wc) { return isxdigit(wc); } int iswxdigit(wint_t wc) { return isxdigit(wc); }
// TODO: need proper implementations of these. // TODO: need proper implementations of these.