summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/locale/tolower.c13
-rw-r--r--lib/libc/locale/toupper.c13
2 files changed, 6 insertions, 20 deletions
diff --git a/lib/libc/locale/tolower.c b/lib/libc/locale/tolower.c
index e72a52c..f8d1623 100644
--- a/lib/libc/locale/tolower.c
+++ b/lib/libc/locale/tolower.c
@@ -45,17 +45,10 @@ ___tolower(c)
int x;
_RuneRange *rr = &_CurrentRuneLocale->maplower_ext;
_RuneEntry *re = rr->ranges;
-#endif
- if (c == EOF)
- return(EOF);
- if (c < 0) {
- if (c >= -128) /* signed char */
- return(_CurrentRuneLocale->maplower[(unsigned char)c]);
- else
- return(c);
- }
-#ifdef XPG4
+ if (c < 0 || c == EOF)
+ return(c);
+
for (x = 0; x < rr->nranges; ++x, ++re) {
if (c < re->min)
return(c);
diff --git a/lib/libc/locale/toupper.c b/lib/libc/locale/toupper.c
index 08be64b..9e60977 100644
--- a/lib/libc/locale/toupper.c
+++ b/lib/libc/locale/toupper.c
@@ -45,17 +45,10 @@ ___toupper(c)
int x;
_RuneRange *rr = &_CurrentRuneLocale->mapupper_ext;
_RuneEntry *re = rr->ranges;
-#endif
- if (c == EOF)
- return(EOF);
- if (c < 0) {
- if (c >= -128) /* signed char */
- return(_CurrentRuneLocale->mapupper[(unsigned char)c]);
- else
- return(c);
- }
-#ifdef XPG4
+ if (c < 0 || c == EOF)
+ return(c);
+
for (x = 0; x < rr->nranges; ++x, ++re) {
if (c < re->min)
return(c);
OpenPOWER on IntegriCloud